Make WordPress Core


Ignore:
Timestamp:
06/05/2025 08:43:08 AM (10 months ago)
Author:
audrasjb
Message:

Customize: Prevent errors occuring with Classic Theme without Widgets.

This changeset prevents the customizer from displaying a warning when a classic theme has no widget area.

Props ArtZ91, SirLouen, audrasjb, dilipbheda.
Fixes #63151.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-widgets.php

    r59676 r60279  
    922922                <h3>
    923923                    <span class="customize-action">
    924                     <?php
     924                        <?php
     925                        $panel       = $this->manager->get_panel( 'widgets' );
     926                        $panel_title = $panel && isset( $panel->title ) ? $panel->title : __( 'Widgets' );
    925927                        /* translators: &#9656; is the unicode right-pointing triangle. %s: Section title in the Customizer. */
    926                         printf( __( 'Customizing &#9656; %s' ), esc_html( $this->manager->get_panel( 'widgets' )->title ) );
    927                     ?>
     928                        printf( __( 'Customizing &#9656; %s' ), esc_html( $panel_title ) );
     929                        ?>
    928930                    </span>
    929931                    <?php _e( 'Add a Widget' ); ?>
Note: See TracChangeset for help on using the changeset viewer.