WP_User::get_caps_data()privateWP 4.9.0

Gets the available user capabilities data.

Method of the class: WP_User{}

No Hooks.

Return

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() code WP 6.6.2

private function get_caps_data() {
	$caps = get_user_meta( $this->ID, $this->cap_key, true );

	if ( ! is_array( $caps ) ) {
		return array();
	}

	return $caps;
}