Skip to content

Commit

Permalink
Quality: fix php warning error (#61321)
Browse files Browse the repository at this point in the history
* Quality: fix php warning error

* Reduce nesting level

Co-authored-by: t-hamano <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
  • Loading branch information
3 people authored May 2, 2024
1 parent ed67830 commit 3492848
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/compat/wordpress-6.6/compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
function gutenberg_change_patterns_link_and_remove_template_parts_submenu_item() {
if ( ! wp_is_block_theme() ) {
global $submenu;

if ( empty( $submenu['themes.php'] ) ) {
return;
}

foreach ( $submenu['themes.php'] as $key => $item ) {
if ( 'edit.php?post_type=wp_block' === $item[2] ) {
$submenu['themes.php'][ $key ][2] = 'site-editor.php?path=/patterns';
Expand Down

0 comments on commit 3492848

Please sign in to comment.