On this page
WP_Roles::_init()
This method has been deprecated. Use WP_Roles::for_site() instead.
Sets up the object properties.
Description
The role key is set to the current prefix for the $wpdb object with ‘user_roles’ appended. If the $wp_user_roles global is set, then it will be used and the role option will not be updated or used.
Source
File: wp-includes/class-wp-roles.php. View all references
protected function _init() {
_deprecated_function( __METHOD__, '4.9.0', 'WP_Roles::for_site()' );
$this->for_site();
}
Related
Uses
| Uses | Description |
|---|---|
| WP_Roles::for_site() wp-includes/class-wp-roles.php | Sets the site to operate on. Defaults to the current site. |
| _deprecated_function() wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
Used By
| Used By | Description |
|---|---|
| WP_Roles::__call() wp-includes/class-wp-roles.php | Makes private/protected methods readable for backward compatibility. |
Changelog
| Version | Description |
|---|---|
| 4.9.0 | Use WP_Roles::for_site() |
| 2.1.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_roles/_init