View difference between Paste ID: fEk3XDDZ and rqBjL3mB
SHOW: | | - or go back to the newest paste.
1-
<?php 
1+
2
* Paste this code in functions.php of your child theme.
3
* And visit yourdomain.com/wp-admin once. Doesn't matter if you are logged-in or not.
4
* Then remove this code!!!
5
* Go to network-admin > users and check the super-admin tab
6
*/
7
add_action( 'admin_init', 'bboss_make_user_superadmin' );
8
function bboss_make_user_superadmin(){
9
    //@todo: replace this with the real username
10
    $username = 'andre';
11
    
12
    $user = get_user_by( 'login', $username );
13
    if( !empty( $user ) ){
14
        if( is_multisite() ){
15
            grant_super_admin( $user->ID );
16
        }
17
    }
18
}