Make WordPress Core


Ignore:
Timestamp:
09/04/2012 04:29:28 PM (13 years ago)
Author:
ryan
Message:

Use get_post() instead of global $post.
Make the $post argument to get_post() optional, defaulting to the current post in The Loop.

Props nacin
see #21309

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/author-template.php

    r20615 r21735  
    7070 */
    7171function get_the_modified_author() {
    72     global $post;
    73     if ( $last_id = get_post_meta($post->ID, '_edit_last', true) ) {
     72    if ( $last_id = get_post_meta( get_post()->ID, '_edit_last', true) ) {
    7473        $last_user = get_userdata($last_id);
    7574        return apply_filters('the_modified_author', $last_user->display_name);
     
    165164 */
    166165function get_the_author_posts() {
    167     global $post;
    168     return count_user_posts($post->post_author);
     166    return count_user_posts( get_post()->post_author );
    169167}
    170168
Note: See TracChangeset for help on using the changeset viewer.