Checks if the user can refresh this partial.
Returns false if the user cannot manipulate one of the associated settings, or if one of the associated settings does not exist.
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;
}
| Version | Description |
|---|---|
| 4.5.0 | Introduced. |
© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_customize_partial/check_capabilities