$menu_item ) { if ( str_contains( $menu_item[2], 'site-editor.php?postType=wp_template_part' ) && ! str_contains( $menu_item[2], 'path=' ) ) { $submenu['themes.php'][ $index ][2] = 'site-editor.php?postType=wp_template_part&path=/wp_template_part/all'; break; } } } add_action( 'admin_menu', 'gutenberg_update_template_parts_menu_url' );