Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

HeavenCore on ""Show Toolbar when viewing site"& wp_insert_user()"

$
0
0

Hi there,

When creating a new user in code via wp_insert_user() - how does one specify false for the "Show Toolbar when viewing site" setting found under the default Wordpress Admin GUI?

My code thus far:

$userdata = array(
        'user_login'    =>  $Email,
        'user_pass'     =>  $Password,
        'user_email'    =>  $Email,
        'display_name'  =>  $FirstName . " " . $LastName,
        'nickname'      =>  $FirstName,
        'first_name'    =>  $FirstName,
        'last_name'     =>  $LastName,
        'description'   =>  'Created via custom Registration Page - ' . date("YmdHis")
    );

    //#### Create the WordPress user
    $user_id = wp_insert_user( $userdata ) ;

    //#### Check user was created OK, if not, return error, if so, return userID
    if( is_wp_error($user_id) ) {
        custom_ajax_exit("ERROR:" . $user_id->get_error_message());
    } else {
        custom_ajax_exit("OK:" . $user_id);
    }

Viewing all articles
Browse latest Browse all 8245

Trending Articles