• Resolved Daniel Men?ies

    (@kungtiger)


    Hey Samir,

    if I could offer one small suggestion:
    One thing I noticed is that you are hiding the comments statistics on the dashboard widget On a Glance via jQuery. This could be done with CSS at disable-comments.php:334:

    #dashboard_right_now .comment-count,
    #dashboard_right_now .comment-mod-count {
      display: none !important  }

    If you move this CSS into the head instead of the footer, is will solve those statistics briefly showing before jQuery kicks in.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Samir Shah

    (@solarissmoke)

    Hi,

    Thanks for this suggestion – I’ll add it to the next release! I’m not really sure why it was done in JS in the first place.

    Samir

    Thread Starter Daniel Men?ies

    (@kungtiger)

    I’ve done some more fiddling around:
    You can hook directly into the head and print some CSS:
    disable-comments.php#L1884
    It also hides the option on the user’s profile page about keyboard shortcuts for comment moderation.

    add_action('admin_print_styles', array($this, 'hide_admin_bits'));
    
    function hide_admin_bits() {
        switch (get_current_screen()->id) {
            case 'dashboard':
                echo '<style type="text/css">#dashboard_right_now .comment-count, #dashboard_right_now .comment-mod-count {display: none !important}</style>';
                break;
            case 'profile':
                echo '<style type="text/css">.user-comment-shortcuts-wrap {display: none !important}</style>';
                break;
        }
    }
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Dashboard: CSS instead of jQuery’ is closed to new replies.