WP_Customize_Partial::check_capabilities()

Checks if the user can refresh this partial.


Description Description

Returns false if the user cannot manipulate one of the associated settings, or if one of the associated settings does not exist.


Return Return

(bool) False if user can't edit one of the related settings, or if one of the associated settings does not exist.


Top ↑

Source Source

File: wp-includes/customize/class-wp-customize-partial.php

	final public function check_capabilities() {
		if ( ! empty( $this->capability ) && ! current_user_can( $this->capability ) ) {
			return false;
		}
		foreach ( $this->settings as $setting_id ) {
			$setting = $this->component->manager->get_setting( $setting_id );
			if ( ! $setting || ! $setting->check_capabilities() ) {
				return false;
			}
		}
		return true;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
4.5.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.