Agregar clases de rol al body en WordPress

58

add_filter( 'body_class', function( $classes ){
    foreach( (array) wp_get_current_user()->roles as $role ){
        $classes[] = "role-$role";
    }
    return $classes;
});

Comments

Submit
0 Comments