On this page
WP_User::get_caps_data(): bool[]
This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
Gets the available user capabilities data.
Return
bool[] List of capabilities keyed by the capability name, e.g. array( 'edit_posts' => true, 'delete_posts' => false ).
Source
File: wp-includes/class-wp-user.php. View all references
private function get_caps_data() {
$caps = get_user_meta( $this->ID, $this->cap_key, true );
if ( ! is_array( $caps ) ) {
return array();
}
return $caps;
}
Related
Uses
| Uses | Description |
|---|---|
| get_user_meta() wp-includes/user.php | Retrieves user meta field for a user. |
Used By
| Used By | Description |
|---|---|
| WP_User::for_site() wp-includes/class-wp-user.php | Sets the site to operate on. Defaults to the current site. |
| WP_User::_init_caps() wp-includes/class-wp-user.php | Sets up capability object properties. |
Changelog
| Version | Description |
|---|---|
| 4.9.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_user/get_caps_data