mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-10-04 14:47:02 +00:00
Customizer: Remove Menus panel when a theme does not support menus
By overriding check_capabilities(), we can ensure that the Menus panel is removed if a theme does not have support for 'menus' nor 'widgets'. This ensures that the Menus panel does not appear when using a block theme, which is confusing to users. See #54888. Props hellofromTonya, costdev, peterwilsoncc. git-svn-id: https://develop.svn.wordpress.org/trunk@52621 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -232,10 +232,11 @@ class WP_Customize_Panel {
|
||||
* feature support required by the panel.
|
||||
*
|
||||
* @since 4.0.0
|
||||
* @since 5.9.0 Method was marked non-final.
|
||||
*
|
||||
* @return bool False if theme doesn't support the panel or the user doesn't have the capability.
|
||||
*/
|
||||
final public function check_capabilities() {
|
||||
public function check_capabilities() {
|
||||
if ( $this->capability && ! current_user_can( $this->capability ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user