Make WordPress Core

Ticket #47652: 47652.patch

File 47652.patch, 476 bytes (added by johnjamesjacoby, 7 years ago)

Add empty() checks to $num_posts variable to avoid debug notices

  • wp-admin/includes/dashboard.php

     
    267267        // Posts and Pages
    268268        foreach ( array( 'post', 'page' ) as $post_type ) {
    269269                $num_posts = wp_count_posts( $post_type );
    270                 if ( $num_posts && $num_posts->publish ) {
     270                if ( ! empty( $num_posts ) && ! empty( $num_posts->publish ) ) {
    271271                        if ( 'post' == $post_type ) {
    272272                                $text = _n( '%s Post', '%s Posts', $num_posts->publish );
    273273                        } else {