From b9256951701a0a13e7abb28a75108947ef9ee030 Mon Sep 17 00:00:00 2001 From: nacin Date: Wed, 25 Jan 2012 00:09:30 +0000 Subject: [PATCH] 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 --- wp-includes/ms-functions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 15a3158db..b1aaa83b1 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -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']) ) {