From 844dd38b8f85c03013437ff0675fde8ee06fefdf Mon Sep 17 00:00:00 2001 From: Andrew 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: https://develop.svn.wordpress.org/trunk@19748 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 15a3158dbc..b1aaa83b17 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']) ) {