Make WordPress Core


Ignore:
Timestamp:
03/29/2022 03:57:05 PM (2 years ago)
Author:
audrasjb
Message:

Administration: Do not specify menu order for the Widgets menu when the active theme is a block theme.

When using a block theme that declares Widgets support, it's better to not specify a menu order for the Widgets menu to avoid conflicts between menu items order.

Props Rufus87, ironprogrammer, audrasjb, hellofromTonya, davidbaumwald.
Fixes #54916.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r53018 r53020  
    52275227 *
    52285228 * @since 2.2.0
     5229 * @since 5.9.3 Don't specify menu order when the active theme is a block theme.
    52295230 *
    52305231 * @global array $submenu
     
    52375238    }
    52385239
    5239     $submenu['themes.php'][7] = array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' );
     5240    $menu_name = __( 'Widgets' );
     5241    if ( wp_is_block_theme() ) {
     5242        $submenu['themes.php'][] = array( $menu_name, 'edit_theme_options', 'widgets.php' );
     5243    } else {
     5244        $submenu['themes.php'][7] = array( $menu_name, 'edit_theme_options', 'widgets.php' );
     5245    }
     5246
    52405247    ksort( $submenu['themes.php'], SORT_NUMERIC );
    52415248}
Note: See TracChangeset for help on using the changeset viewer.