This method has been deprecated. Use WP_User::for_site() instead.

WP_User::_init_caps( string $cap_key = '' )

Set 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_key

(Optional) capability key

Default value: ''


Source

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

	protected function _init_caps( $cap_key = '' ) {
		global $wpdb;

		_deprecated_function( __METHOD__, 'WP-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();
	}


Changelog

Changelog
Version Description
WP-4.9.0 Use WP_User::for_site()
WP-2.1.0 Introduced. This method has been deprecated. Use WP_User::for_site() instead.