On this page
WP_Roles::__construct( int $site_id = null )
Constructor.
Parameters
$site_idint Optional-
Site ID to initialize roles for. Default is the current site.
Default:
null
Source
File: wp-includes/class-wp-roles.php. View all references
public function __construct( $site_id = null ) {
global $wp_user_roles;
$this->use_db = empty( $wp_user_roles );
$this->for_site( $site_id );
}
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. |
Used By
| Used By | Description |
|---|---|
| wp_initialize_site() wp-includes/ms-site.php | Runs the initialization routine for a given site. |
| wp_roles() wp-includes/capabilities.php | Retrieves the global WP_Roles instance and instantiates it if necessary. |
| install_blog() wp-includes/ms-deprecated.php | Install an empty blog. |
Changelog
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_roles/__construct