Make WordPress Core

Changeset 19748


Ignore:
Timestamp:
01/25/2012 12:09:30 AM (14 years ago)
Author:
nacin
Message:

Use get_blog_prefix() in get_most_recent_post_of_user(). see #19891.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/ms-functions.php

    r19747 r19748  
    13691369    // published by $user_id
    13701370    foreach ( (array) $user_blogs as $blog ) {
    1371         $recent_post = $wpdb->get_row( $wpdb->prepare("SELECT ID, post_date_gmt FROM {$wpdb->base_prefix}{$blog->userblog_id}_posts WHERE post_author = %d AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1", $user_id ), ARRAY_A);
     1371        $prefix = $wpdb->get_blog_prefix( $blog->userblog_id );
     1372        $recent_post = $wpdb->get_row( $wpdb->prepare("SELECT ID, post_date_gmt FROM {$prefix}posts WHERE post_author = %d AND post_type = 'post' AND post_status = 'publish' ORDER BY post_date_gmt DESC LIMIT 1", $user_id ), ARRAY_A);
    13721373
    13731374        // Make sure we found a post
Note: See TracChangeset for help on using the changeset viewer.