is_super_admin

Advertisement

Summery Summery

Determine if user is a site admin.

Syntax Syntax

is_super_admin( int $user_id = false )

Parameters Parameters

$user_id

(Optional) (Optional) The ID of a user. Defaults to the current user.

Default value: false

Return Return

(bool) True if the user is a site admin.

Source Source

File: wp-includes/capabilities.php

/**
 * Add role, if it does not exist.
 *
 * @since 2.0.0
 *
 * @param string $role         Role name.
 * @param string $display_name Display name for role.
 * @param bool[] $capabilities List of capabilities keyed by the capability name,
 *                             e.g. array( 'edit_posts' => true, 'delete_posts' => false ).
 * @return WP_Role|null WP_Role object if role is added, null if already exists.
 */
function add_role( $role, $display_name, $capabilities = array() ) {
	if ( empty( $role ) ) {
		return;
	}
	return wp_roles()->add_role( $role, $display_name, $capabilities );
}

/**
 * Remove role, if it exists.
 *
 * @since 2.0.0
 *

Advertisement

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.

Advertisement

Leave a Reply