Ticket #4758: 6716.patch
| File 6716.patch, 1.0 KB (added by , 14 years ago) |
|---|
-
bp-forums/bp-forums-functions.php
352 352 * @param int $user_id The user id 353 353 */ 354 354 function bp_forums_reply_exists( $text = '', $topic_id = 0, $user_id = 0 ) { 355 global $wpdb;356 355 357 $reply_exists = false;358 359 356 if ( $text && $topic_id && $user_id ) { 360 357 do_action( 'bbpress_init' ); 361 358 362 $ args =array(359 $query = new BB_Query( 'post', array( 363 360 'post_author_id' => $user_id, 364 'topic_id' => $topic_id 365 ); 361 'topic_id' => $topic_id, 362 'post_text' => $text 363 ) ); 366 364 367 // BB_Query's post_text parameter does a MATCH, while we need exact matches368 add_filter( 'get_posts_where', create_function( '$q', 'return $q . " AND p.post_text = \'' . $wpdb->escape( $text ) . '\'";' ) );369 370 $query = new BB_Query( 'post', $args );371 372 365 $reply_exists = !empty( $query->results ); 366 } else { 367 $reply_exists = false; 373 368 } 374 369 375 370 return apply_filters( 'bp_forums_reply_exists', $reply_exists, $text, $topic_id, $user_id );
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)