summaryrefslogtreecommitdiffstats
path: root/wp-admin/menu.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:30 +0000
commitfa9a33d818470a5796f0ff8797f98b510ed8de18 (patch)
treebde6a1eede376f9b5df5898ce812330152984d8e /wp-admin/menu.php
parentReleasing progress-linux version 6.4.3+dfsg1-1~progress7.99u1. (diff)
downloadwordpress-fa9a33d818470a5796f0ff8797f98b510ed8de18.tar.xz
wordpress-fa9a33d818470a5796f0ff8797f98b510ed8de18.zip
Merging upstream version 6.5+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wp-admin/menu.php')
-rw-r--r--wp-admin/menu.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/wp-admin/menu.php b/wp-admin/menu.php
index 567af4a..7959e72 100644
--- a/wp-admin/menu.php
+++ b/wp-admin/menu.php
@@ -127,8 +127,11 @@ foreach ( array_merge( $builtin, $types ) as $ptype ) {
$menu_icon = 'dashicons-admin-post';
if ( is_string( $ptype_obj->menu_icon ) ) {
- // Special handling for data:image/svg+xml and Dashicons.
- if ( str_starts_with( $ptype_obj->menu_icon, 'data:image/svg+xml;base64,' ) || str_starts_with( $ptype_obj->menu_icon, 'dashicons-' ) ) {
+ // Special handling for an empty div.wp-menu-image, data:image/svg+xml, and Dashicons.
+ if ( 'none' === $ptype_obj->menu_icon || 'div' === $ptype_obj->menu_icon
+ || str_starts_with( $ptype_obj->menu_icon, 'data:image/svg+xml;base64,' )
+ || str_starts_with( $ptype_obj->menu_icon, 'dashicons-' )
+ ) {
$menu_icon = $ptype_obj->menu_icon;
} else {
$menu_icon = esc_url( $ptype_obj->menu_icon );
@@ -202,10 +205,12 @@ if ( ! is_multisite() && current_user_can( 'update_themes' ) ) {
if ( wp_is_block_theme() ) {
$submenu['themes.php'][6] = array( _x( 'Editor', 'site editor menu item' ), 'edit_theme_options', 'site-editor.php' );
+} else {
+ $submenu['themes.php'][6] = array( __( 'Patterns' ), 'edit_theme_options', 'edit.php?post_type=wp_block' );
}
if ( ! wp_is_block_theme() && current_theme_supports( 'block-template-parts' ) ) {
- $submenu['themes.php'][6] = array(
+ $submenu['themes.php'][7] = array(
__( 'Template Parts' ),
'edit_theme_options',
'site-editor.php?path=/wp_template_part/all',
@@ -217,7 +222,7 @@ $customize_url = add_query_arg( 'return', urlencode( remove_query_arg( wp_remova
// Hide Customize link on block themes unless a plugin or theme
// is using 'customize_register' to add a setting.
if ( ! wp_is_block_theme() || has_action( 'customize_register' ) ) {
- $position = ( wp_is_block_theme() || current_theme_supports( 'block-template-parts' ) ) ? 7 : 6;
+ $position = ! wp_is_block_theme() && current_theme_supports( 'block-template-parts' ) ? 8 : 7;
$submenu['themes.php'][ $position ] = array( __( 'Customize' ), 'customize', esc_url( $customize_url ), '', 'hide-if-no-customize' );
}