GC_Customize_Partial::check_capabilities()

最后更新于:2021-11-27 07:17:28

GC_Customize_Partial::check_capabilities()

Checks if the user can refresh this partial.

响应

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

源文件

文件: gc-includes/customize/class-gc-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;
	}