WordPress.org

Make WordPress Core


Ignore:
Timestamp:
07/26/2020 10:49:07 AM (18 months ago)
Author:
SergeyBiryukov
Message:

Posts, Post Types: Move get_post_states() back to the admin for now, require the file in WP_Customize_Nav_Menus::customize_register() instead.

This provides a minor performance improvement by only running the function in contexts where it's needed.

Follow-up to [47211], [47213], [47763], [48619].

See #46829, #49374.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-nav-menus.php

    r48199 r48620  
    760760        }
    761761
     762        // Used to denote post states for special pages.
     763        if ( ! function_exists( 'get_post_states' ) ) {
     764            require_once ABSPATH . 'wp-admin/includes/template.php';
     765        }
     766
    762767        // Register each menu as a Customizer section, and add each menu item to each menu.
    763768        foreach ( $menus as $menu ) {
Note: See TracChangeset for help on using the changeset viewer.