Make WordPress Core

Ticket #54028: 54028.diff

File 54028.diff, 6.1 KB (added by johnregan3, 4 years ago)

Diff of what is included in github PR 2401

  • src/wp-admin/edit-form-blocks.php

    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 ); 
    3232_load_remote_block_patterns();
    3333_load_remote_featured_patterns();
    3434
    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 
    4335/*
    4436 * Emoji replacement is disabled for now, until it plays nicely with React.
    4537 */
  • src/wp-admin/includes/admin-filters.php

    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' ); 
    4747add_action( 'admin_head', 'wp_admin_viewport_meta' );
    4848add_action( 'customize_controls_head', 'wp_admin_viewport_meta' );
    4949
     50// Body classes for admin pages.
     51add_filter( 'admin_body_class', 'body_class_edit_form_blocks' );
     52add_filter( 'admin_body_class', 'body_class_options_privacy' );
     53
    5054// Prerendering.
    5155if ( ! is_customize_preview() ) {
    5256        add_filter( 'admin_print_styles', 'wp_resource_hints', 1 );
  • src/wp-admin/includes/misc.php

    diff --git src/wp-admin/includes/misc.php src/wp-admin/includes/misc.php
    index f8cf82acf7..b8b1c22837 100644
    function wp_check_php_version() { 
    15711571
    15721572        return $response;
    15731573}
     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 */
     1582function 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 */
     1598function 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}
  • src/wp-admin/options-privacy.php

    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'] ) { 
    1818        return;
    1919}
    2020
    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 
    3021$action = isset( $_POST['action'] ) ? $_POST['action'] : '';
    3122
    3223get_current_screen()->add_help_tab(
  • src/wp-admin/privacy-policy-guide.php

    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' ) ) { 
    1717        include_once ABSPATH . 'wp-admin/includes/class-wp-privacy-policy-content.php';
    1818}
    1919
    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 
    2920wp_enqueue_script( 'privacy-tools' );
    3021
    3122require_once ABSPATH . 'wp-admin/admin-header.php';
  • src/wp-includes/sitemaps/class-wp-sitemaps-renderer.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 { 
    251251         */
    252252        private function check_for_simple_xml_availability() {
    253253                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' ) );
    260255
    261256                        wp_die(
    262257                                sprintf(
    class WP_Sitemaps_Renderer { 
    271266                        );
    272267                }
    273268        }
     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        }
    274280}
  • src/wp-includes/theme.php

    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() ) { 
    19961996         * Filters the `css` (`post_content`) and `preprocessed` (`post_content_filtered`) args
    19971997         * for a `custom_css` post being updated.
    19981998         *
    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
    20002000         * 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:
    20032001         *
    20042002         * <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;
    20092008         *     }
    2010          *     return $css;
    2011          * }, 10, 2 );
     2009         *     return $data;
     2010         * }
    20122011         * </code>
    20132012         *
    20142013         * @since 4.7.0