Plugin Directory

Changeset 792384


Ignore:
Timestamp:
10/23/2013 03:25:52 PM (11 years ago)
Author:
lessbloat
Message:

Hide "Site Content" line items if there are zero of them. This way people running a website won't always have to stare at a sad "0 comments" link.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • dashboard/trunk/rightnow.php

    r787085 r792384  
    103103    foreach ( $post_types as $post_type => $post_type_obj ){
    104104        $num_posts = wp_count_posts( $post_type );
    105         if ( $num_posts ) {
     105        if ( $num_posts && $num_posts->publish ) {
    106106            printf(
    107107                '<li class="%1$s-count"><a href="edit.php?post_type=%1$s">%2$s %3$s</a></li>',
     
    114114    // Comments
    115115    $num_comm = wp_count_comments();
    116     if ( $num_comm ) {
     116    if ( $num_comm && $num_comm->total_comments ) {
    117117        $text = _n( 'comment', 'comments', $num_comm->total_comments );
    118118        printf(
Note: See TracChangeset for help on using the changeset viewer.