summaryrefslogtreecommitdiffstats
path: root/wp-admin/menu.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:26 +0000
commit30883c26bdceb9eaf32c8d4a1b0c1bce223b5226 (patch)
tree39a02e2aeb21ab5b7923c6f5757d66d55b708912 /wp-admin/menu.php
parentAdding upstream version 6.4.3+dfsg1. (diff)
downloadwordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.tar.xz
wordpress-30883c26bdceb9eaf32c8d4a1b0c1bce223b5226.zip
Adding upstream version 6.5+dfsg1.upstream/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' );
}