WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/is super admin

Description

Determine if user is a network (super) admin. Will also check if user is admin if network mode is disabled.

Usage

 <?php is_super_admin$user_id ); ?> 

Parameters

$user_id
(integer) (optional) The ID of a user.
Default: Defaults to the current user.

Returns

(boolean) 
True if the user is network (super) admin. Also returns True if network mode is disabled and the user is an admin.

Example

<?php
//Removes the "Edit" menu for users who are not Super Admins of a multisite network
if ( !is_super_admin() ) {
	add_action( 'admin_init', 'my_remove_edit_menu' );
}
function my_remove_edit_menu() {
	remove_menu_page('edit.php');
}
?>

Changelog

Since: WordPress 3.0.0

Source Code

is_super_admin() is located in wp-includes/capabilities.php.

Related

See also index of Function Reference and index of Template Tags.