Make WordPress Core

Changeset 53021


Ignore:
Timestamp:
03/29/2022 04:22:29 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.
Merges [53020] to the 5.9 branch.
Fixes #54916.

Location:
branches/5.9
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.9

  • branches/5.9/src/wp-includes/functions.php

    r52629 r53021  
    51865186 *
    51875187 * @since 2.2.0
     5188 * @since 5.9.3 Don't specify menu order when the active theme is a block theme.
    51885189 *
    51895190 * @global array $submenu
     
    51965197    }
    51975198
    5198     $submenu['themes.php'][7] = array( __( 'Widgets' ), 'edit_theme_options', 'widgets.php' );
     5199    $menu_name = __( 'Widgets' );
     5200    if ( wp_is_block_theme() ) {
     5201        $submenu['themes.php'][] = array( $menu_name, 'edit_theme_options', 'widgets.php' );
     5202    } else {
     5203        $submenu['themes.php'][7] = array( $menu_name, 'edit_theme_options', 'widgets.php' );
     5204    }
     5205
    51995206    ksort( $submenu['themes.php'], SORT_NUMERIC );
    52005207}
Note: See TracChangeset for help on using the changeset viewer.