[wp-trac] [WordPress Trac] #54795: Bootstrap: Move navigation post type hooks to `admin-filters.php`

WordPress Trac noreply at wordpress.org
Mon Jan 17 18:19:48 UTC 2022


#54795: Bootstrap: Move navigation post type hooks to `admin-filters.php`
----------------------------+---------------------
 Reporter:  dlh             |       Owner:  (none)
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  6.0
Component:  Bootstrap/Load  |     Version:
 Severity:  normal          |  Resolution:
 Keywords:                  |     Focuses:
----------------------------+---------------------
Changes (by hellofromTonya):

 * version:  trunk =>
 * milestone:  Awaiting Review => 6.0


Comment:

 Hello @dlh,

 That's a great find and something that needs consideration for the reasons
 you raised.

 A quick walkthrough of the `wp-includes/default-filters.php` file has
 these "admin" hooks:

 - 5.8 in [51003] adds:
 {{{
 add_action( 'admin_footer-post.php', 'wp_add_iframed_editor_assets_html'
 );
 add_action( 'admin_footer-post-new.php',
 'wp_add_iframed_editor_assets_html' );
 }}}

 - 5.8 in [51388] adds:
 {{{
 add_action( 'admin_head', 'wp_check_widget_editor_deps' );
 }}}

 - 5.9 in [52069] adds:
 {{{
 add_action( 'admin_footer-widgets.php',
 'wp_add_iframed_editor_assets_html' );
 }}}

 - 5.9 in [52160] adds:
 {{{
 add_action( 'admin_footer-site-editor.php',
 'wp_add_iframed_editor_assets_html' );
 }}}

 - 5.9 in [52145] adds:
 {{{
 add_action( 'use_block_editor_for_post_type',
 '_disable_block_editor_for_navigation_post_type', 10, 2 );
 add_action( 'edit_form_after_title',
 '_disable_content_editor_for_navigation_post_type' );
 add_action( 'edit_form_after_editor',
 '_enable_content_editor_for_navigation_post_type' );
 }}}

 There are other "admin" hooks in the file too for Customizer, calendar
 widget cache, post submenus (hooked to `admin_menu`), etc.

 I agree that an audit is needed to identify admin-only functions, i.e.
 callbacks that are not loaded into memory when not in the admin area.

 Given that there are "admin" hooks in the file before 5.9, removing
 `trunk` as the Version and moving this ticket into 6.0.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54795#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list