WordPress at a glance

wp_roles() WP 1.0

Retrieves the global WP_Roles instance and instantiates it if necessary.

Notes:

  • Global. WP_Roles. $wp_roles WP_Roles global instance.
Is the basis for: get_role(), add_role(), remove_role()
✈ 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();

Code of wp_roles: wp-includes/capabilities.php VER 4.9.8

<?php
function wp_roles() {
	global $wp_roles;

	if ( ! isset( $wp_roles ) ) {
		$wp_roles = new WP_Roles();
	}
	return $wp_roles;
}

Related Functions

From tag: Roles capabilities

No comments
    Hello, !     Log In . Register