WP_Customize_Nav_Menus_Panel::check_capabilities()publicWP 5.9.0

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

{} Это метод класса: WP_Customize_Nav_Menus_Panel{}

Хуков нет.

Возвращает

true|false. False if theme doesn't support the panel or the user doesn't have the capability.

Использование

$WP_Customize_Nav_Menus_Panel = new WP_Customize_Nav_Menus_Panel();
$WP_Customize_Nav_Menus_Panel->check_capabilities();

Список изменений

С версии 5.9.0 Введена.

Код WP_Customize_Nav_Menus_Panel::check_capabilities() WP 6.0

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();
}