WP_Customize_Nav_Menus_Panel::check_capabilities() WordPress Method

The WP_Customize_Nav_Menus_Panel::check_capabilities() method is used to check if the current user has the required capabilities to access this panel.

WP_Customize_Nav_Menus_Panel::check_capabilities() #

Checks required user capabilities and whether the theme has the feature support required by the panel.


Return

(bool) False if theme doesn't support the panel or the user doesn't have the capability.


Top ↑

Source

File: wp-includes/customize/class-wp-customize-nav-menus-panel.php

	public function check_capabilities() {
		/*
		 * WP_Customize_Panel::$theme_supports only supports checking one
		 * theme_supports, so instead we override check_capabilities().
		 */
		if (
			! current_theme_supports( 'menus' ) &&
			! current_theme_supports( 'widgets' )
		) {
			return false;
		}

		return parent::check_capabilities();
	}


Top ↑

Changelog

Changelog
VersionDescription
5.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.