hi, i am trying to hide a css element for a specific role of the displayed user. for now it is not working. i need some help.
<?php
add_action( 'wp_head', 'get_user_role' );
function get_user_role() {
// Get Current User Data.
$user = get_userdata( bp_displayed_user_id() );
// Get Roles.
$roles = (array) $user->roles;
$user_role = array_shift($user_roles);
if ($user_role == "editor"){
?>
<style type="text/css">#qa-52778a {display: none!important;}</style>
<?php
};
};