Make WordPress Core

Ticket #2498: 2498.diff

File 2498.diff, 411 bytes (added by technosailor, 20 years ago)

tests for the existence of $posts[0]->ID

  • wp-includes/functions.php

     
    14001400        global $wpdb;
    14011401
    14021402        // No point in doing all this work if we didn't match any posts.
    1403         if ( !$posts )
     1403        if ( !$posts || !$posts[0]->ID )
    14041404                return;
    14051405
    14061406        // Get the categories for all the posts