Ticket #7523: 7523.deleted.patch
| File 7523.deleted.patch, 2.4 KB (added by , 9 years ago) |
|---|
-
src/bp-members/bp-members-functions.php
206 206 * 207 207 * @since 1.2.0 208 208 * 209 * @param int $user_id The ID of the user.210 * @return array 209 * @param int $user_id The ID of the user. 210 * @return array|bool Array of data on success, boolean false on failure. 211 211 */ 212 212 function bp_core_get_core_userdata( $user_id = 0 ) { 213 213 if ( empty( $user_id ) ) { 214 214 return false; 215 215 } 216 216 217 if ( !$userdata = wp_cache_get( 'bp_core_userdata_' . $user_id, 'bp' ) ) { 217 $userdata = wp_cache_get( 'bp_core_userdata_' . $user_id, 'bp' ); 218 219 // No cache. 220 if ( false === $userdata ) { 218 221 $userdata = BP_Core_User::get_core_userdata( $user_id ); 219 wp_cache_set( 'bp_core_userdata_' . $user_id, $userdata, 'bp' ); 222 223 // Cache data; no-result is cached as integer 0. 224 wp_cache_set( 'bp_core_userdata_' . $user_id, false === $userdata ? 0 : $userdata, 'bp' ); 225 226 // Cached no-result, so set return value as false as expected. 227 } elseif ( 0 === $userdata ) { 228 $userdata = false; 220 229 } 221 230 222 231 /** … … 224 233 * 225 234 * @since 1.2.0 226 235 * 227 * @param array $userdata Array of user data for a passed user.236 * @param array|bool $userdata Array of user data for a passed user on success, boolean false on failure. 228 237 */ 229 238 return apply_filters( 'bp_core_get_core_userdata', $userdata ); 230 239 } -
src/bp-messages/bp-messages-template.php
1996 1996 function bp_get_the_thread_message_content() { 1997 1997 global $thread_template; 1998 1998 1999 $content = $thread_template->message->message; 2000 2001 // If user was deleted, mark content as deleted. 2002 if ( false === bp_core_get_core_userdata( bp_get_the_thread_message_sender_id() ) ) { 2003 $content = esc_html__( '[deleted]', 'buddypress' ); 2004 } 2005 1999 2006 /** 2000 2007 * Filters the content of the current message in the loop. 2001 2008 * … … 2003 2010 * 2004 2011 * @param string $message The content of the current message in the loop. 2005 2012 */ 2006 return apply_filters( 'bp_get_the_thread_message_content', $ thread_template->message->message);2013 return apply_filters( 'bp_get_the_thread_message_content', $content ); 2007 2014 } 2008 2015 2009 2016 /** Embeds *******************************************************************/