Changeset 5827 for trunk/src/includes/users/capabilities.php
- Timestamp:
- 07/14/2015 12:31:42 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/users/capabilities.php
r5770 r5827 383 383 * @since bbPress (r3405) 384 384 * 385 * @global WPDB $wpdb386 385 * @param int $user_id Optional. User ID to spam. Defaults to displayed user. 387 386 … … 420 419 421 420 // Arm the torpedos 422 global $wpdb;421 $bbp_db = bbp_db(); 423 422 424 423 // Get the blog IDs of the user to mark as spam … … 427 426 // If user has no blogs, they are a guest on this site 428 427 if ( empty( $blogs ) ) { 429 $blogs[ $ wpdb->blogid ] = array();428 $blogs[ $bbp_db->blogid ] = array(); 430 429 } 431 430 … … 441 440 442 441 // Get topics and replies 443 $posts = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_author = %d AND post_status = '%s' AND post_type IN ( {$post_types} )", $user_id, bbp_get_public_status_id() ) ); 442 $query = $bbp_db->prepare( "SELECT ID FROM {$bbp_db->posts} WHERE post_author = %d AND post_status = '%s' AND post_type IN ( {$post_types} )", $user_id, bbp_get_public_status_id() ); 443 $posts = $bbp_db->get_col( $query ); 444 444 445 445 // Loop through posts and spam them … … 475 475 * @since bbPress (r3405) 476 476 * 477 * @global WPDB $wpdb478 477 * @param int $user_id Optional. User ID to unspam. Defaults to displayed user. 479 478 * … … 511 510 512 511 // Arm the torpedos 513 global $wpdb;512 $bbp_db = bbp_db(); 514 513 515 514 // Get the blog IDs of the user to mark as spam … … 518 517 // If user has no blogs, they are a guest on this site 519 518 if ( empty( $blogs ) ) { 520 $blogs[ $ wpdb->blogid ] = array();519 $blogs[ $bbp_db->blogid ] = array(); 521 520 } 522 521 … … 532 531 533 532 // Get topics and replies 534 $posts = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM {$wpdb->posts} WHERE post_author = %d AND post_status = '%s' AND post_type IN ( {$post_types} )", $user_id, bbp_get_spam_status_id() ) ); 533 $query = $bbp_db->prepare( "SELECT ID FROM {$bbp_db->posts} WHERE post_author = %d AND post_status = '%s' AND post_type IN ( {$post_types} )", $user_id, bbp_get_spam_status_id() ); 534 $posts = $bbp_db->get_col( $query ); 535 535 536 536 // Loop through posts and spam them
Note: See TracChangeset
for help on using the changeset viewer.