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

git-svn-id: http://svn.automattic.com/wordpress/trunk@19748 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-01-25 00:09:30 +00:00
parent 18804349bb
commit b925695170
1 changed files with 2 additions and 1 deletions

View File

@ -1368,7 +1368,8 @@ function get_most_recent_post_of_user( $user_id ) {
// Walk through each blog and get the most recent post
// published by $user_id
foreach ( (array) $user_blogs as $blog ) {
$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);
$prefix = $wpdb->get_blog_prefix( $blog->userblog_id );
$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);
// Make sure we found a post
if ( isset($recent_post['ID']) ) {