• Resolved roostergr

    (@roostergr)


    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}

    • This topic was modified 7 years, 7 months ago by roostergr.
    • This topic was modified 7 years, 7 months ago by roostergr.
    • This topic was modified 7 years, 7 months ago by roostergr.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter roostergr

    (@roostergr)

    I forgot to mention that I want these modifications only for Editors.
    With the usage of Custom CSS field of the WP Custom Admin Interface, I have the results for every user, even the Admin…

    Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    Hi @roostergr,

    The CSS customisation we provide does not allow targeting of the CSS based on role. What I suggest is you just create your own plugin or add to your functions.php file to do such a customisation because it seems you are advanced enough to do so! 🙂

    Thread Starter roostergr

    (@roostergr)

    Thanks for your quick answer. Do you think to include this capability (code per role) in a future update?
    This would make your plugin not only perfect, but …divine!

    Keep your nice work!!!!!!

    Plugin Author Northern Beaches Websites

    (@northernbeacheswebsites)

    Hi @roostergr,

    It’s something I will consider; I am just heaps short on time and because this is a free plugin it takes a backseat to all my paid work which pays the bills. Thanks,

    Thread Starter roostergr

    (@roostergr)

    Anyway… Hope you the best and really THANKS !

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Custom CSS per User Role issues’ is closed to new replies.