function global_profile_hide_admin_bar() { $checkprofiles = get_option('global-admin-bar-roles'); // global-admin-bar-profiles $userrole = get_profile_user_role(); if (get_option('global-admin-bar-plugin-user-setting') == '1' && in_array($userrole, $checkprofiles)) { add_action('edit_user_profile', 'hide_your_profile_admin_tool_bar'); add_action('show_user_profile', 'hide_your_profile_admin_tool_bar'); } else { return; } }
function global_profile_hide_admin_bar() { if (get_option('global-admin-bar-plugin-user-setting') == '1') { $checkProfiles = get_option('global-admin-bar-profiles'); $userrole = get_profile_user_role(); if (is_array($checkProfiles) && in_array($userrole, $checkProfiles)) { echo '<style type="text/css">.show-admin-bar{display:none !important}</style>'; } } return; }