From 6d43d90b5f7b8a3319e887eb180db0b5fdf4bfe6 Mon Sep 17 00:00:00 2001 From: Weston Ruter Date: Fri, 7 Oct 2022 20:46:39 +0000 Subject: [PATCH] Customize: Prevent PHP notice in Customizer when using block theme. Use the `customize_panel_active` filter to deactivate the Menus panel instead of overriding the `check_capabilities` method. This ensures the panel remains registered but is still hidden. See #54888. Fixes #54905. git-svn-id: https://develop.svn.wordpress.org/trunk@54419 602fd350-edb4-49c9-b593-d223f7449a82 --- .../class-wp-customize-nav-menus-panel.php | 23 ------------------- src/wp-includes/theme.php | 19 +++++++++++++++ 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/wp-includes/customize/class-wp-customize-nav-menus-panel.php b/src/wp-includes/customize/class-wp-customize-nav-menus-panel.php index 18328e5d3f..c0d098bc7d 100644 --- a/src/wp-includes/customize/class-wp-customize-nav-menus-panel.php +++ b/src/wp-includes/customize/class-wp-customize-nav-menus-panel.php @@ -98,27 +98,4 @@ class WP_Customize_Nav_Menus_Panel extends WP_Customize_Panel {
  • id && + ! current_theme_supports( 'menus' ) && + ! current_theme_supports( 'widgets' ) + ) { + $active = false; + } + return $active; + }, + 10, + 2 + ); }