WordPress at a glance
function is not described

WP_Customize_Control::check_capabilities() public WP 3.4.0

Checks if the user can use this control.

Returns false if the user cannot manipulate one of the associated settings, or if one of the associated settings does not exist. Also returns false if the associated section does not exist or if its capability check returns false.

{} It's a method of the class: WP_Customize_Control{}

No Hooks.

Return

true/false. False if theme doesn't support the control or user doesn't have the required permissions, otherwise true.

Usage

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

Changelog

Since 3.4.0 Introduced.

Code of WP_Customize_Control::check_capabilities() WP 5.5.1

<?php
final public function check_capabilities() {
	if ( ! empty( $this->capability ) && ! current_user_can( $this->capability ) ) {
		return false;
	}

	foreach ( $this->settings as $setting ) {
		if ( ! $setting || ! $setting->check_capabilities() ) {
			return false;
		}
	}

	$section = $this->manager->get_section( $this->section );
	if ( isset( $section ) && ! $section->check_capabilities() ) {
		return false;
	}

	return true;
}