Uses
Uses | Description |
---|---|
wp-includes/class-wp-roles.php: WP_Roles::for_site() | Sets the site to operate on. Defaults to the current site. |
Constructor
(int) (Optional) Site ID to initialize roles for. Default is the current site.
Default value: null
File: wp-includes/class-wp-roles.php
public function __construct( $site_id = null ) { global $wp_user_roles; $this->use_db = empty( $wp_user_roles ); $this->for_site( $site_id ); }
Version | Description |
---|---|
4.9.0 | The $site_id argument was added. |
2.0.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_roles/__construct