wp_roles
Retrieves the global WP_Roles instance and instantiates it if necessary.
Description
(WP_Roles) wp_roles();
Returns (WP_Roles)
WP_Roles global instance if not already instantiated.
Usage
if ( !function_exists( 'wp_roles' ) ) { require_once ABSPATH . WPINC . '/capabilities.php'; } // NOTICE! Understand what this does before running. $result = wp_roles();
Defined (1)
The function is defined in the following location(s).
- /wp-includes/capabilities.php
- functionwp_roles) {
- global $wp_roles;
- if ( ! isset( $wp_roles ) ) {
- $wp_roles = new WP_Roles();
- }
- return $wp_roles;
- }