WordPress at Your Fingertips

wp_roles() WP 1.0

Retrieves the global WP_Roles instance and instantiates it if necessary.

1 time — 0.000017 sec (very fast) | 50000 times — 0.01 sec (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 5.8.1

function wp_roles() {
	global $wp_roles;

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

Roles capabilities

No comments
    Log In