WP_User::_init_caps( string $cap_key = '' )
- Since
- 2.1.0
- Source
wp-includes/class-wp-user.php:477
Sets up capability object properties.
Description
Will set the value for the 'cap_key' property to current database table prefix, followed by 'capabilities'. Will then check to see if the property matching the 'cap_key' exists and is an array. If so, it will be used.
Parameters
$cap_keystringoptional- Optional capability keyDefault:
''
Uses · 3
- _deprecated_function()Marks a function as deprecated and inform when it has been used.
- WP_User::get_caps_data()Gets the available user capabilities data.
- WP_User::get_role_caps()Retrieves all of the capabilities of the user's roles, and merges them with individual user capabilities.
Used by · 1
- WP_User::__call()Makes private/protected methods readable for backward compatibility.
Source
protected function _init_caps( $cap_key = '' ) { global $wpdb; _deprecated_function( __METHOD__, '4.9.0', 'WP_User::for_site()' ); if ( empty( $cap_key ) ) { $this->cap_key = $wpdb->get_blog_prefix( $this->site_id ) . 'capabilities'; } else { $this->cap_key = $cap_key; } $this->caps = $this->get_caps_data(); $this->get_role_caps(); }History
Introduced in 2.1.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
4.9.0
Deprecated. Use WP_User::for_site()from the docblock
2.1.0
Introduced.from the docblock
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 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.