get_super_admins()

Retrieve a list of super admins.


Description Description


Return Return

(array) List of super admin logins


Top ↑

Source Source

File: wp-includes/capabilities.php

function get_super_admins() {
	global $super_admins;

	if ( isset( $super_admins ) ) {
		return $super_admins;
	} else {
		return get_site_option( 'site_admins', array( 'admin' ) );
	}
}

Top ↑

Changelog Changelog

Changelog
Version Description
3.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

  1. Skip to note 1 content
    Contributed by Codex

    Display a list of super admin users

    $super_admins = get_super_admins();
    
    echo __( 'List of super-admin users:', 'textdomain' );
    
    if ( ! empty( $super_admins ) ) {
    	echo '<ul>';
    	
    	foreach ( $super_admins as $admin ) {
    		echo '<li>' . $admin . '</li>';
    	}
    	
    	echo '</ul>';
    }
    

You must log in before being able to contribute a note or feedback.