Make WordPress Core

Changeset 53266


Ignore:
Timestamp:
04/26/2022 06:30:24 AM (2 years ago)
Author:
audrasjb
Message:

Bootstrap/load: Move administration related hooks to admin-filters.php.

This change moves some administration related hooks from default-filters.php to admin-filters.php. It also updates the default-filters.php docblock to indicate that contextualized hooks should be located in the most appropriate place.

Props dlh, hellofromTonya, antonvlasenko, audrasjb, azaozz.
Fixes #54795.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/admin-filters.php

    r53228 r53266  
    1313// Dashboard hooks.
    1414add_action( 'activity_box_end', 'wp_dashboard_quota' );
     15add_action( 'welcome_panel', 'wp_welcome_panel' );
    1516
    1617// Media hooks.
     
    3738add_filter( 'media_upload_tabs', 'update_gallery_tab' );
    3839
     40// Admin color schemes.
     41add_action( 'admin_head', 'wp_color_scheme_settings' );
     42add_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
     43
    3944// Misc hooks.
    4045add_action( 'admin_init', 'wp_admin_headers' );
    4146add_action( 'login_init', 'wp_admin_headers' );
    4247add_action( 'admin_head', 'wp_admin_canonical_url' );
    43 add_action( 'admin_head', 'wp_color_scheme_settings' );
    4448add_action( 'admin_head', 'wp_site_icon' );
    4549add_action( 'admin_head', 'wp_admin_viewport_meta' );
    4650add_action( 'customize_controls_head', 'wp_admin_viewport_meta' );
     51add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object' );
    4752
    4853// Prerendering.
     
    7075
    7176add_filter( 'heartbeat_settings', 'wp_heartbeat_set_suspension' );
     77
     78add_action( 'use_block_editor_for_post_type', '_disable_block_editor_for_navigation_post_type', 10, 2 );
     79add_action( 'edit_form_after_title', '_disable_content_editor_for_navigation_post_type' );
     80add_action( 'edit_form_after_editor', '_enable_content_editor_for_navigation_post_type' );
    7281
    7382// Nav Menu hooks.
  • trunk/src/wp-includes/default-filters.php

    r53160 r53266  
    88 * hook.
    99 *
    10  * Not all of the default hooks are found in default-filters.php
     10 * Not all of the default hooks are found in this file.
     11 * For instance, administration related hooks are located in
     12 * wp-admin/includes/admin-filters.php.
     13 *
     14 * If a hook should only be called from a specific context
     15 * (admin area, multisite environment…), please move it
     16 * to a more appropriate file instead.
    1117 *
    1218 * @package WordPress
     
    294300add_filter( 'editable_slug', 'urldecode' );
    295301add_filter( 'editable_slug', 'esc_textarea' );
    296 add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object' );
    297302add_filter( 'pingback_ping_source_uri', 'pingback_ping_source_uri' );
    298303add_filter( 'xmlrpc_pingback_error', 'xmlrpc_pingback_error' );
     
    414419add_action( 'comment_form', 'wp_comment_form_unfiltered_html_nonce' );
    415420add_action( 'admin_init', 'send_frame_options_header', 10, 0 );
    416 add_action( 'welcome_panel', 'wp_welcome_panel' );
    417421
    418422// Privacy.
     
    463467// Admin color schemes.
    464468add_action( 'admin_init', 'register_admin_color_schemes', 1 );
    465 add_action( 'admin_color_scheme_picker', 'admin_color_scheme_picker' );
    466469
    467470// If the upgrade hasn't run yet, assume link manager is used.
     
    592595add_action( 'wp_footer', 'wp_maybe_inline_styles', 1 ); // Run for late-loaded styles in the footer.
    593596
    594 add_action( 'use_block_editor_for_post_type', '_disable_block_editor_for_navigation_post_type', 10, 2 );
    595 add_action( 'edit_form_after_title', '_disable_content_editor_for_navigation_post_type' );
    596 add_action( 'edit_form_after_editor', '_enable_content_editor_for_navigation_post_type' );
    597 
    598597/*
    599598 * Disable "Post Attributes" for wp_navigation post type. The attributes are
Note: See TracChangeset for help on using the changeset viewer.