lundi 30 juillet 2018

If username is in the list, do this else do that. [Wordpress]

I'm trying to display some content only for the following usernames: Admin, Jake, Shadow, Kid.

My current code is something like this:

add_action( 'wp_enqueue_scripts', 'load_script' );
function load_script(){
if( is_user_logged_in() ){
    // Display content only for the following usernames: Admin, Jake, Shadow, Kid.
} else { 
    // User is not logged in or is logged in but not in the list.
}
}

Thanks in advance!

Aucun commentaire:

Enregistrer un commentaire