Alert: 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.

WP_User::get_caps_data() WordPress Method

The WP_User::get_caps_data() function is used to get the capabilities of a user. The function returns an array of the user's capabilities.

WP_User::get_caps_data() #

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 ).


Top ↑

Source

File: wp-includes/class-wp-user.php

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

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

		return $caps;
	}


Top ↑

Changelog

Changelog
VersionDescription
4.9.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.