wp_roles() WP 1.0
Retrieves the global WP_Roles instance and instantiates it if necessary.
1 time = 0.000017s = very fast | 50000 times = 0.01s = speed of light
No Hooks.
Return
WP_Roles. WP_Roles global instance if not already instantiated.
Usage
wp_roles();
Notes
- Global. WP_Roles. $wp_roles WordPress role management object.
Changelog
Since 4.3.0 | Introduced. |
Code of wp_roles() wp roles WP 5.6
function wp_roles() {
global $wp_roles;
if ( ! isset( $wp_roles ) ) {
$wp_roles = new WP_Roles();
}
return $wp_roles;
}