wppaste
WordPress

WP_User

Since
2.0.0, 6.8.0
Source
wp-includes/class-wp-user.php:41
Core class used to implement the WP_User object.

Hooks fired · 6

Every hook that fires from inside WP_User, in the order it appears in the class, grouped by the method that fires it.

Properties · 9

$datastdClasspublic
User data container.
$IDintpublic
The user's ID.
$capsbool[]public
Capabilities that the individual user has been granted outside of those inherited from their role.
$cap_keystringpublic
User metadata option name.
$rolesstring[]public
The roles the user is part of.
$allcapsbool[]public
All capabilities the user has, including individual and role based.
$filterstringpublic
The filter context applied to user data fields.
$site_idintprivate
The site ID the capabilities of this user are initialized for.
$back_compat_keysarrayprivate static

Methods · 28

Source

#[AllowDynamicProperties]class WP_User {	/**	 * User data container.	 *	 * @since 2.0.0	 * @var stdClass	 */	public $data; 	/**	 * The user's ID.	 *	 * @since 2.1.0	 * @var int	 */	public $ID = 0; 	/**	 * Capabilities that the individual user has been granted outside of those inherited from their role.	 *	 * @since 2.0.0	 * @var bool[] Array of key/value pairs where keys represent a capability name	 *             and boolean values represent whether the user has that capability.	 */	public $caps = array(); 	/**	 * User metadata option name.	 *	 * @since 2.0.0	 * @var string	 */	public $cap_key; 	/**	 * The roles the user is part of.	 *	 * @since 2.0.0	 * @var string[]	 */	public $roles = array(); 	/**	 * All capabilities the user has, including individual and role based.	 *	 * @since 2.0.0	 * @var bool[] Array of key/value pairs where keys represent a capability name	 *             and boolean values represent whether the user has that capability.	 */	public $allcaps = array(); 	/**	 * The filter context applied to user data fields.	 *	 * @since 2.9.0	 * @var string	 */	public $filter = null; 	/**	 * The site ID the capabilities of this user are initialized for.	 *	 * @since 4.9.0	 * @var int	 */	private $site_id = 0; 	/**	 * @since 3.3.0	 * @var array	 */	private static $back_compat_keys; 	/**	 * Constructor.	 *	 * Retrieves the userdata and passes it to WP_User::init().	 *	 * @since 2.0.0

History

Introduced in 2.0.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

6.8.0
The user_pass property is now hashed using bcrypt by default instead of phpass. Existing passwords may still be hashed using phpass.from the docblock
2.0.0
Introduced.from the docblock

About this page

Parsed data
Generated from the wordpress-develop 6.8.8 tag, from src/wp-includes/class-wp-user.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.