WP_User::get_caps_data
Gets the available user capabilities data.
Method of the class: WP_User{}
No Hooks.
Returns
true|false[]. List of capabilities keyed by the capability name, e.g. array('edit_posts'=> true,'delete_posts'=> false ).
Usage
// private - for code of main (parent) class only $result = $this->get_caps_data();
Changelog
| Since 4.9.0 | Introduced. |
WP_User::get_caps_data() WP User::get caps data code WP 7.0.2
private function get_caps_data() {
$caps = get_user_meta( $this->ID, $this->cap_key, true );
if ( ! is_array( $caps ) ) {
return array();
}
return $caps;
}