Add this snippet to functions.php
function add_css_to_guest_user() { $guest_user = wp_get_current_user(); if($guest_user && isset($guest_user->user_login) && 'guest' == $guest_user->user_login) { wp_enqueue_style( 'guest_admin_css', get_stylesheet_directory_uri() . '/css/wpadmin-guest.css' ); } } add_action('admin_print_styles', 'add_css_to_guest_user' );
2) CSS
If You want to hide the CF7 menu item on guest user’s WordPress admin use this CSS
#toplevel_page_wpcf7 { display: none; }
Leave a Reply