WordPress.org

Make WordPress Core

Ticket #45152: 45152.2.diff

File 45152.2.diff, 4.5 KB (added by SergeyBiryukov, 3 years ago)
  • src/wp-admin/includes/upgrade.php

     
    319319        update_option( 'widget_archives', array ( 2 => array ( 'title' => '', 'count' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) );
    320320        update_option( 'widget_categories', array ( 2 => array ( 'title' => '', 'count' => 0, 'hierarchical' => 0, 'dropdown' => 0 ), '_multiwidget' => 1 ) );
    321321        update_option( 'widget_meta', array ( 2 => array ( 'title' => '' ), '_multiwidget' => 1 ) );
    322         update_option( 'sidebars_widgets', array( 'wp_inactive_widgets' => array(), 'sidebar-1' => array( 0 => 'search-2', 1 => 'recent-posts-2', 2 => 'recent-comments-2', 3 => 'archives-2', 4 => 'categories-2', 5 => 'meta-2' ), 'sidebar-2' => array(), 'sidebar-3' => array(), 'array_version' => 3 ) );
     322        update_option( 'sidebars_widgets', array( 'wp_inactive_widgets' => array(), 'array_version' => 3 ) );
    323323        if ( ! is_multisite() )
    324324                update_user_meta( $user_id, 'show_welcome_panel', 1 );
    325325        elseif ( ! is_super_admin( $user_id ) && ! metadata_exists( 'user', $user_id, 'show_welcome_panel' ) )
  • src/wp-admin/nav-menus.php

     
    519519if ( ! $locations_screen ) : // Main tab
    520520        $overview  = '<p>' . __( 'This screen is used for managing your navigation menus.' ) . '</p>';
    521521        /* translators: 1: Widgets admin screen URL, 2 and 3: The name of the default themes */
    522         $overview .= '<p>' . sprintf( __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href="%1$s">Widgets</a> screen. If your theme does not support the navigation menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Sixteen', 'Twenty Seventeen' ) . '</p>';
     522        $overview .= '<p>' . sprintf( __( 'Menus can be displayed in locations defined by your theme, even used in sidebars by adding a &#8220;Navigation Menu&#8221; widget on the <a href="%1$s">Widgets</a> screen. If your theme does not support the navigation menus feature (the default themes, %2$s and %3$s, do), you can learn about adding this support by following the Documentation link to the side.' ), admin_url( 'widgets.php' ), 'Twenty Seventeen', 'Twenty Nineteen' ) . '</p>';
    523523        $overview .= '<p>' . __( 'From this screen you can:' ) . '</p>';
    524524        $overview .= '<ul><li>' . __( 'Create, edit, and delete menus' ) . '</li>';
    525525        $overview .= '<li>' . __( 'Add, organize, and modify individual menu items' ) . '</li></ul>';
  • tests/phpunit/tests/customize/manager.php

     
    16351635
    16361636                $old_sidebars_widgets = get_option( 'sidebars_widgets' );
    16371637                $new_sidebars_widgets = $old_sidebars_widgets;
     1638
     1639                if ( ! isset( $new_sidebars_widgets['sidebar-1'] ) ) {
     1640                        $this->markTestSkipped( 'Current theme does not have sidebars.' );
     1641                }
     1642
    16381643                $this->assertGreaterThan( 2, count( $new_sidebars_widgets['sidebar-1'] ) );
    16391644                $new_sidebar_1 = array_reverse( $new_sidebars_widgets['sidebar-1'] );
    16401645
  • tests/phpunit/tests/customize/widgets.php

     
    3232
    3333                unset( $GLOBALS['_wp_sidebars_widgets'] ); // clear out cache set by wp_get_sidebars_widgets()
    3434                $sidebars_widgets = wp_get_sidebars_widgets();
    35                 $this->assertEqualSets( array( 'wp_inactive_widgets', 'sidebar-1', 'sidebar-2', 'sidebar-3' ), array_keys( wp_get_sidebars_widgets() ) );
     35
     36                if ( ! isset( $sidebars_widgets['sidebar-1'] ) ) {
     37                        $this->markTestSkipped( 'Current theme does not have sidebars.' );
     38                }
     39
     40                $this->assertEqualSets( array( 'wp_inactive_widgets', 'sidebar-1', 'sidebar-2', 'sidebar-3' ), array_keys( $sidebars_widgets ) );
    3641                $this->assertContains( 'search-2', $sidebars_widgets['sidebar-1'] );
    3742                $this->assertContains( 'categories-2', $sidebars_widgets['sidebar-1'] );
    3843                $this->assertArrayHasKey( 2, get_option( 'widget_search' ) );