WP_Roles::reinit()publicWP 3.5.0

Deprecated from version 4.7.0. It is no longer supported and can be removed in future releases. Use WP_Roles::for_site() instead.

Reinitializes the object.

Recreates the role objects. This is typically called only by switch_to_blog() after switching wpdb to a new site ID.

Method of the class: WP_Roles{}

No Hooks.

Return

null. Nothing (null).

Usage

global $wp_roles;
$wp_roles->reinit();

Changelog

Since 3.5.0 Introduced.
Deprecated since 4.7.0 Use WP_Roles::for_site()

WP_Roles::reinit() code WP 6.5.2

public function reinit() {
	_deprecated_function( __METHOD__, '4.7.0', 'WP_Roles::for_site()' );

	$this->for_site();
}