Title: WP_Customize_Setting::check_capabilities
Published: April 25, 2014
Last modified: April 28, 2025

---

# WP_Customize_Setting::check_capabilities(): bool

## In this article

 * [Return](https://developer.wordpress.org/reference/classes/wp_customize_setting/check_capabilities/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_customize_setting/check_capabilities/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_customize_setting/check_capabilities/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_customize_setting/check_capabilities/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_customize_setting/check_capabilities/?output_format=md#wp--skip-link--target)

Validate user capabilities whether the theme supports the setting.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_customize_setting/check_capabilities/?output_format=md#return)󠁿

 bool False if theme doesn’t support the setting or user can’t change setting, otherwise
true.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_customize_setting/check_capabilities/?output_format=md#source)󠁿

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

    	if ( $this->theme_supports && ! current_theme_supports( ...(array) $this->theme_supports ) ) {
    		return false;
    	}

    	return true;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-customize-setting.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/class-wp-customize-setting.php#L839)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/class-wp-customize-setting.php#L839-L849)

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_customize_setting/check_capabilities/?output_format=md#related)󠁿

| Uses | Description | 
| [current_user_can()](https://developer.wordpress.org/reference/functions/current_user_can/)`wp-includes/capabilities.php` |

Returns whether the current user has the specified capability.

  | 
| [current_theme_supports()](https://developer.wordpress.org/reference/functions/current_theme_supports/)`wp-includes/theme.php` |

Checks a theme’s support for a given feature.

  |

| Used by | Description | 
| [WP_Customize_Setting::save()](https://developer.wordpress.org/reference/classes/wp_customize_setting/save/)`wp-includes/class-wp-customize-setting.php` |

Checks user capabilities and theme supports, and then saves the value of the setting.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_customize_setting/check_capabilities/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_customize_setting%2Fcheck_capabilities%2F)
before being able to contribute a note or feedback.