Custom CSS per User Role issues
-
I wanted to load custom CSS per user role (ie. for Editor), so I did the followings:
A. In the Custom PHP field of the WP Custom Admin Interface I have added:
function wpse_load_editor_stylesheet() {
if ( current_user_can( ‘editor’ ) ) {
wp_enqueue_style( ‘login-editor-style’, home_url( ‘/login/editor-style.css’ ) );
}
}
add_action( ‘wp_enqueue_scripts’, ‘wpse_load_editor_stylesheet’ );B. In the editor-style.css field I have added:<br/>
#dt_page_box-post_options, #dt_page_box-header_options {
display:none !important;
}With this way I succeded to suppress the dt_page_box-post_options but not the dt_page_box-header_options div….
But if I write into the Custom CSS field of the WP Custom Admin Interface the same css (*) I have the results I want. What’s the problem with the Header options metabox? Why this is still exists? Any ideas?
(*)
#dt_page_box-header_options, #dt_page_box-slideshow_options {display:none}
The topic ‘Custom CSS per User Role issues’ is closed to new replies.