Make WordPress Core

Ticket #54905: issue-56142.diff

File issue-56142.diff, 2.9 KB (added by bobbingwide, 3 years ago)

Patch for 56142 - a duplicate of 54905 - to avoid 3 Warning messages from the Customizer for FSE theme

  • src/wp-includes/class-wp-customize-nav-menus.php

    diff --git a/src/wp-includes/class-wp-customize-nav-menus.php b/src/wp-includes/class-wp-customize-nav-menus.php
    index ae0925fe02..6b4b0cb2d9 100644
    a b final class WP_Customize_Nav_Menus { 
    495495                        /* translators: %s: Number of menu locations. */
    496496                        $locations_description = sprintf( _n( 'Your theme can display menus in %s location.', 'Your theme can display menus in %s locations.', $num_locations ), number_format_i18n( $num_locations ) );
    497497                }
     498                $panel = $this->manager->get_panel( 'menus' );
     499                $section_title = ( null !== $panel ) ? $panel->title : __( 'Menus');
    498500
    499501                // Pass data to JS.
    500502                $settings = array(
    final class WP_Customize_Nav_Menus { 
    520522                                'movedLeft'              => __( 'Menu item moved out of submenu' ),
    521523                                'movedRight'             => __( 'Menu item is now a sub-item' ),
    522524                                /* translators: ▸ is the unicode right-pointing triangle. %s: Section title in the Customizer. */
    523                                 'customizingMenus'       => sprintf( __( 'Customizing ▸ %s' ), esc_html( $this->manager->get_panel( 'nav_menus' )->title ) ),
     525                                'customizingMenus'       => sprintf( __( 'Customizing ▸ %s' ), esc_html( $section_title ) ),
    524526                                /* translators: %s: Title of an invalid menu item. */
    525527                                'invalidTitleTpl'        => __( '%s (Invalid)' ),
    526528                                /* translators: %s: Title of a menu item in draft status. */
    final class WP_Customize_Nav_Menus { 
    11481150                                <h3>
    11491151                                        <span class="customize-action">
    11501152                                                <?php
     1153                                                        $panel = $this->manager->get_panel( 'menus' );
     1154                                                        $section_title = ( null !== $panel ) ? $panel->title : __( 'Menus');
    11511155                                                        /* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */
    1152                                                         printf( __( 'Customizing &#9656; %s' ), esc_html( $this->manager->get_panel( 'nav_menus' )->title ) );
     1156                                                        printf( __( 'Customizing &#9656; %s' ), esc_html( $section_title ) );
    11531157                                                ?>
    11541158                                        </span>
    11551159                                        <?php _e( 'Add Menu Items' ); ?>
  • src/wp-includes/class-wp-customize-widgets.php

    diff --git a/src/wp-includes/class-wp-customize-widgets.php b/src/wp-includes/class-wp-customize-widgets.php
    index 9b4a0fa1c5..825c2fc923 100644
    a b final class WP_Customize_Widgets { 
    895895                                <h3>
    896896                                        <span class="customize-action">
    897897                                        <?php
     898                                                $panel = $this->manager->get_panel( 'widgets' );
     899                                                $section_title = ( null !== $panel ) ? $panel->title : __( 'Widgets' );
    898900                                                /* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */
    899                                                 printf( __( 'Customizing &#9656; %s' ), esc_html( $this->manager->get_panel( 'widgets' )->title ) );
     901                                                printf( __( 'Customizing &#9656; %s' ), esc_html( $section_title ) );
    900902                                        ?>
    901903                                        </span>
    902904                                        <?php _e( 'Add a Widget' ); ?>