Post Reads 180 reads

Check logged in user role. Use function  wp_get_current_user() to get the current/logged in user info.

Usage:

var_dump( prefix_user_has_role( 'administrator' ) );

// Output:
// bool(true)

Snippet:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top
%d bloggers like this: