Make WordPress Core

Ticket #54905: 54905.diff

File 54905.diff, 3.4 KB (added by azouamauriac, 3 years ago)

Patch updated.

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

     
    519519                                'movedDown'              => __( 'Menu item moved down' ),
    520520                                'movedLeft'              => __( 'Menu item moved out of submenu' ),
    521521                                'movedRight'             => __( 'Menu item is now a sub-item' ),
    522                                 /* 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 ) ),
    524522                                /* translators: %s: Title of an invalid menu item. */
    525523                                'invalidTitleTpl'        => __( '%s (Invalid)' ),
    526524                                /* translators: %s: Title of a menu item in draft status. */
     
    543541                        ),
    544542                        'locationSlugMappedToName' => get_registered_nav_menus(),
    545543                );
     544                $nav_menus = $this->manager->get_panel( 'nav_menus' );
     545                if ( $nav_menus ) {
     546                        /* translators: ▸ is the unicode right-pointing triangle. %s: Section title in the Customizer. */
     547                        $settings['l10n']['customizingMenus'] = sprintf( __( 'Customizing ▸ %s' ), esc_html( $nav_menus->title ) );
     548                }
    546549
    547550                $data = sprintf( 'var _wpCustomizeNavMenusSettings = %s;', wp_json_encode( $settings ) );
    548551                wp_scripts()->add_data( 'customize-nav-menus', 'data', $data );
     
    11461149                                        <span class="screen-reader-text"><?php _e( 'Back' ); ?></span>
    11471150                                </button>
    11481151                                <h3>
    1149                                         <span class="customize-action">
    1150                                                 <?php
    1151                                                         /* 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 ) );
     1152                                        <?php
     1153                                        $nav_menus = $this->manager->get_panel( 'nav_menus' );
     1154                                        if ( $nav_menus ) :
    11531155                                                ?>
    1154                                         </span>
     1156                                                <span class="customize-action">
     1157                                                        <?php
     1158                                                                /* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */
     1159                                                                printf( __( 'Customizing &#9656; %s' ), esc_html( $nav_menus->title ) );
     1160                                                        ?>
     1161                                                </span>
     1162                                        <?php endif; ?>
    11551163                                        <?php _e( 'Add Menu Items' ); ?>
    11561164                                </h3>
    11571165                        </div>
  • src/wp-includes/class-wp-customize-widgets.php

     
    893893                                        <span class="screen-reader-text"><?php _e( 'Back' ); ?></span>
    894894                                </button>
    895895                                <h3>
    896                                         <span class="customize-action">
    897896                                        <?php
    898                                                 /* 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 ) );
    900                                         ?>
    901                                         </span>
     897                                        $widgets = $this->manager->get_panel( 'widgets' );
     898                                        if ( $widgets ) :
     899                                                ?>
     900                                                <span class="customize-action">
     901                                                <?php
     902                                                        /* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */
     903                                                        printf( __( 'Customizing &#9656; %s' ), esc_html( $widgets->title ) );
     904                                                ?>
     905                                                </span>
     906                                        <?php endif; ?>
    902907                                        <?php _e( 'Add a Widget' ); ?>
    903908                                </h3>
    904909                        </div>