Ticket #18408: 18408.5.diff
File 18408.5.diff, 1.2 KB (added by , 2 years ago) |
---|
-
src/wp-admin/includes/admin-filters.php
50 50 add_action( 'admin_head', 'wp_site_icon' ); 51 51 add_action( 'admin_head', 'wp_admin_viewport_meta' ); 52 52 add_action( 'customize_controls_head', 'wp_admin_viewport_meta' ); 53 add_action( 'loop_start', '_preserve_global_post' ); 53 54 add_filter( 'nav_menu_meta_box_object', '_wp_nav_menu_meta_box_object' ); 54 55 55 56 // Prerendering. -
src/wp-admin/includes/misc.php
1641 1641 1642 1642 return $response; 1643 1643 } 1644 1645 /** 1646 * Store the current post into the global WP_Query object. 1647 * This will allow developers to reset to the global query 1648 * whenever secondary queries are run. 1649 * 1650 * @since 6.3.0 1651 * @access private 1652 */ 1653 function _preserve_global_post() { 1654 global $wp_query, $post; 1655 1656 if( null === $wp_query->post ) { 1657 $wp_query->post = $post; 1658 } 1659 }