wppaste
WordPress

WP_Roles::get_roles_data(): array

Since
4.9.0
Source
wp-includes/class-wp-roles.php:373
Gets the available roles data.

Return

array
Roles array.

Uses · 6

Used by · 1

Source

	protected function get_roles_data() {		global $wp_user_roles; 		if ( ! empty( $wp_user_roles ) ) {			return $wp_user_roles;		} 		if ( is_multisite() && get_current_blog_id() !== $this->site_id ) {			remove_action( 'switch_blog', 'wp_switch_roles_and_user', 1 ); 			$roles = get_blog_option( $this->site_id, $this->role_key, array() ); 			add_action( 'switch_blog', 'wp_switch_roles_and_user', 1, 2 ); 			return $roles;		} 		return get_option( $this->role_key, array() );	}

History

Introduced in 4.9.0. Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/class-wp-roles.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.