diff --git src/wp-admin/edit-form-blocks.php src/wp-admin/edit-form-blocks.php
index 0268bc8ae8..79e8e5e919 100644
|
|
|
$current_screen->is_block_editor( true ); |
| 32 | 32 | _load_remote_block_patterns(); |
| 33 | 33 | _load_remote_featured_patterns(); |
| 34 | 34 | |
| 35 | | // Default to is-fullscreen-mode to avoid jumps in the UI. |
| 36 | | add_filter( |
| 37 | | 'admin_body_class', |
| 38 | | static function( $classes ) { |
| 39 | | return "$classes is-fullscreen-mode"; |
| 40 | | } |
| 41 | | ); |
| 42 | | |
| 43 | 35 | /* |
| 44 | 36 | * Emoji replacement is disabled for now, until it plays nicely with React. |
| 45 | 37 | */ |
diff --git src/wp-admin/includes/admin-filters.php src/wp-admin/includes/admin-filters.php
index d03881c8ac..23e4a1163b 100644
|
|
|
add_action( 'admin_head', 'wp_site_icon' ); |
| 47 | 47 | add_action( 'admin_head', 'wp_admin_viewport_meta' ); |
| 48 | 48 | add_action( 'customize_controls_head', 'wp_admin_viewport_meta' ); |
| 49 | 49 | |
| | 50 | // Body classes for admin pages. |
| | 51 | add_filter( 'admin_body_class', 'body_class_edit_form_blocks' ); |
| | 52 | add_filter( 'admin_body_class', 'body_class_options_privacy' ); |
| | 53 | |
| 50 | 54 | // Prerendering. |
| 51 | 55 | if ( ! is_customize_preview() ) { |
| 52 | 56 | add_filter( 'admin_print_styles', 'wp_resource_hints', 1 ); |
diff --git src/wp-admin/includes/misc.php src/wp-admin/includes/misc.php
index f8cf82acf7..b8b1c22837 100644
|
|
|
function wp_check_php_version() { |
| 1571 | 1571 | |
| 1572 | 1572 | return $response; |
| 1573 | 1573 | } |
| | 1574 | |
| | 1575 | /** |
| | 1576 | * Adds 'is-fullscreen-mode' body class in Block Editor screens to |
| | 1577 | * avoid jumps in the UI. |
| | 1578 | * |
| | 1579 | * @param string $classes Space-separated list of CSS classes. |
| | 1580 | * @return string $classes String of classes. |
| | 1581 | */ |
| | 1582 | function body_class_edit_form_blocks( $classes ) { |
| | 1583 | $current_screen = get_current_screen(); |
| | 1584 | |
| | 1585 | if ( ! is_null( $current_screen->id ) && in_array( $current_screen->id, array( 'post', 'page' ) ) ) { |
| | 1586 | $classes .= ' is-fullscreen-mode'; |
| | 1587 | } |
| | 1588 | |
| | 1589 | return $classes; |
| | 1590 | } |
| | 1591 | |
| | 1592 | /** |
| | 1593 | * Adds 'options-privacy' in Privacy Options page. |
| | 1594 | * |
| | 1595 | * @param string $classes Space-separated list of CSS classes. |
| | 1596 | * @return string $classes String of classes. |
| | 1597 | */ |
| | 1598 | function body_class_options_privacy( $classes ) { |
| | 1599 | $current_screen = get_current_screen(); |
| | 1600 | |
| | 1601 | if ( ! is_null( $current_screen->id ) && 'options-privacy' === $current_screen->id ) { |
| | 1602 | $classes .= ' privacy-settings'; |
| | 1603 | } |
| | 1604 | |
| | 1605 | return $classes; |
| | 1606 | } |
diff --git src/wp-admin/options-privacy.php src/wp-admin/options-privacy.php
index fbd69f23a7..08bdc95340 100644
|
|
|
if ( isset( $_GET['tab'] ) && 'policyguide' === $_GET['tab'] ) { |
| 18 | 18 | return; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | | add_filter( |
| 22 | | 'admin_body_class', |
| 23 | | static function( $body_class ) { |
| 24 | | $body_class .= ' privacy-settings '; |
| 25 | | |
| 26 | | return $body_class; |
| 27 | | } |
| 28 | | ); |
| 29 | | |
| 30 | 21 | $action = isset( $_POST['action'] ) ? $_POST['action'] : ''; |
| 31 | 22 | |
| 32 | 23 | get_current_screen()->add_help_tab( |
diff --git src/wp-admin/privacy-policy-guide.php src/wp-admin/privacy-policy-guide.php
index 6581bb412a..69055b1193 100644
|
|
|
if ( ! class_exists( 'WP_Privacy_Policy_Content' ) ) { |
| 17 | 17 | include_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php'; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | | add_filter( |
| 21 | | 'admin_body_class', |
| 22 | | static function( $body_class ) { |
| 23 | | $body_class .= ' privacy-settings '; |
| 24 | | |
| 25 | | return $body_class; |
| 26 | | } |
| 27 | | ); |
| 28 | | |
| 29 | 20 | wp_enqueue_script( 'privacy-tools' ); |
| 30 | 21 | |
| 31 | 22 | require_once ABSPATH . 'wp-admin/admin-header.php'; |
diff --git src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php src/wp-includes/sitemaps/class-wp-sitemaps-renderer.php
index 0069b11126..0bc607e26b 100644
|
|
|
class WP_Sitemaps_Renderer { |
| 251 | 251 | */ |
| 252 | 252 | private function check_for_simple_xml_availability() { |
| 253 | 253 | if ( ! class_exists( 'SimpleXMLElement' ) ) { |
| 254 | | add_filter( |
| 255 | | 'wp_die_handler', |
| 256 | | static function () { |
| 257 | | return '_xml_wp_die_handler'; |
| 258 | | } |
| 259 | | ); |
| | 254 | add_filter( 'wp_die_handler', array( __CLASS__, 'return_xml_wp_die_handler' ) ); |
| 260 | 255 | |
| 261 | 256 | wp_die( |
| 262 | 257 | sprintf( |
| … |
… |
class WP_Sitemaps_Renderer { |
| 271 | 266 | ); |
| 272 | 267 | } |
| 273 | 268 | } |
| | 269 | |
| | 270 | /** |
| | 271 | * Returns the _xml_wp_die_handler function name. |
| | 272 | * |
| | 273 | * Used to prevent using a lambda function in the 'wp_die_handler' filter. |
| | 274 | * |
| | 275 | * @return string The XML WP Die handler function name. |
| | 276 | */ |
| | 277 | protected static function return_xml_wp_die_handler() { |
| | 278 | return '_xml_wp_die_handler'; |
| | 279 | } |
| 274 | 280 | } |
diff --git src/wp-includes/theme.php src/wp-includes/theme.php
index ed24f677ef..acb6ae92a6 100644
|
|
|
function wp_update_custom_css_post( $css, $args = array() ) { |
| 1996 | 1996 | * Filters the `css` (`post_content`) and `preprocessed` (`post_content_filtered`) args |
| 1997 | 1997 | * for a `custom_css` post being updated. |
| 1998 | 1998 | * |
| 1999 | | * This filter can be used by plugin that offer CSS pre-processors, to store the original |
| | 1999 | * This filter can be used by plugins that offer CSS pre-processors to store the original |
| 2000 | 2000 | * pre-processed CSS in `post_content_filtered` and then store processed CSS in `post_content`. |
| 2001 | | * When used in this way, the `post_content_filtered` should be supplied as the setting value |
| 2002 | | * instead of `post_content` via a the `customize_value_custom_css` filter, for example: |
| 2003 | 2001 | * |
| 2004 | 2002 | * <code> |
| 2005 | | * add_filter( 'customize_value_custom_css', function( $value, $setting ) { |
| 2006 | | * $post = wp_get_custom_css_post( $setting->stylesheet ); |
| 2007 | | * if ( $post && ! empty( $post->post_content_filtered ) ) { |
| 2008 | | * $css = $post->post_content_filtered; |
| | 2003 | * add_filter( 'update_custom_css_data', 'my_update_custom_css_data', '10, 2 ); |
| | 2004 | * function my_update_custom_css_data( $data, $args ) { |
| | 2005 | * $css_post = wp_get_custom_css_post( $args['stylesheet'] ); |
| | 2006 | * if ( $css_post && ! empty( $css_post->post_content_filtered ) ) { |
| | 2007 | * $data['post_content_filtered'] = $css_post->post_content_filtered; |
| 2009 | 2008 | * } |
| 2010 | | * return $css; |
| 2011 | | * }, 10, 2 ); |
| | 2009 | * return $data; |
| | 2010 | * } |
| 2012 | 2011 | * </code> |
| 2013 | 2012 | * |
| 2014 | 2013 | * @since 4.7.0 |