Make WordPress Core

Ticket #27998: 27998.2.diff

File 27998.2.diff, 489 bytes (added by krogsgard, 12 years ago)

Use ! instead of empty() on the check for get_post().

  • wp-includes/author-template.php

    diff --git wp-includes/author-template.php wp-includes/author-template.php
    index dd225c0..8946251 100644
    function the_author_link() { 
    206206 * @return int The number of posts by the author.
    207207 */
    208208function get_the_author_posts() {
    209         return count_user_posts( get_post()->post_author );
     209        $post = get_post();
     210        if ( ! $post ) {
     211                return 0;
     212        }
     213        return count_user_posts( $post->post_author );
    210214}
    211215
    212216/**