Changeset 6612
- Timestamp:
- 07/04/2017 03:54:06 PM (9 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 4 edited
-
search/template.php (modified) (1 diff)
-
topics/functions.php (modified) (1 diff)
-
users/engagements.php (modified) (3 diffs)
-
users/functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/search/template.php
r6573 r6612 48 48 49 49 // Default view=all statuses 50 $post_statuses = array( 51 bbp_get_public_status_id(), 52 bbp_get_closed_status_id(), 53 bbp_get_spam_status_id(), 54 bbp_get_trash_status_id(), 55 bbp_get_pending_status_id() 56 ); 50 $post_statuses = array_keys( bbp_get_topic_statuses() ); 57 51 58 52 // Add support for private status -
trunk/src/includes/topics/functions.php
r6607 r6612 1824 1824 // Filter & return 1825 1825 return (array) apply_filters( 'bbp_get_topic_statuses', array( 1826 bbp_get_public_status_id() => _x( 'Open', 'Open the topic', 'bbpress' ),1827 bbp_get_closed_status_id() => _x( 'Closed', 'Close the topic', 'bbpress' ),1828 bbp_get_spam_status_id() => _x( 'Spam', 'Spam the topic', 'bbpress' ),1829 bbp_get_trash_status_id() => _x( 'Trash', 'Trash the topic', 'bbpress' ),1830 bbp_get_pending_status_id() => _x( 'Pending', ' Mark topic as pending', 'bbpress' ),1826 bbp_get_public_status_id() => _x( 'Open', 'Open the topic', 'bbpress' ), 1827 bbp_get_closed_status_id() => _x( 'Closed', 'Close the topic', 'bbpress' ), 1828 bbp_get_spam_status_id() => _x( 'Spam', 'Spam the topic', 'bbpress' ), 1829 bbp_get_trash_status_id() => _x( 'Trash', 'Trash the topic', 'bbpress' ), 1830 bbp_get_pending_status_id() => _x( 'Pending', 'Unapprove the topic', 'bbpress' ) 1831 1831 ), $topic_id ); 1832 1832 } -
trunk/src/includes/users/engagements.php
r6607 r6612 960 960 961 961 // Parse arguments 962 $ r= bbp_parse_args( $r['args'], $defaults, "get_{$r['filter']}_args" );962 $query_args = bbp_parse_args( $r['args'], $defaults, "get_{$r['filter']}_args" ); 963 963 964 964 // Queries 965 965 if ( 'post' === $r['meta_type'] ) { 966 $query = new WP_Query( $ r);966 $query = new WP_Query( $query_args ); 967 967 $object_ids = $query->posts; 968 968 } … … 983 983 function bbp_get_moderator_forum_ids( $user_id = 0 ) { 984 984 return bbp_get_user_object_ids( array( 985 'user_id' => $user_id,986 'meta_key' => '_bbp_moderator_id',987 ' post_type' => bbp_get_forum_post_type(),988 'filter' => 'moderator_forum_ids'985 'user_id' => $user_id, 986 'meta_key' => '_bbp_moderator_id', 987 'object_type' => bbp_get_forum_post_type(), 988 'filter' => 'moderator_forum_ids' 989 989 ) ); 990 990 } … … 1035 1035 function bbp_get_user_subscribed_forum_ids( $user_id = 0 ) { 1036 1036 return bbp_get_user_object_ids( array( 1037 'user_id' => $user_id,1038 'meta_key' => '_bbp_subscription',1039 ' post_type' => bbp_get_forum_post_type(),1040 'filter' => 'user_subscribed_forum_ids'1037 'user_id' => $user_id, 1038 'meta_key' => '_bbp_subscription', 1039 'object_type' => bbp_get_forum_post_type(), 1040 'filter' => 'user_subscribed_forum_ids' 1041 1041 ) ); 1042 1042 } -
trunk/src/includes/users/functions.php
r6611 r6612 648 648 $user_id = bbp_get_user_id( $user_id ); 649 649 $bbp_db = bbp_db(); 650 $statii = "'" . implode( "', '", bbp_get_public_topic_statuses() ) . "'"; 650 651 $sql = "SELECT COUNT(*) 651 652 FROM {$bbp_db->posts} 652 653 WHERE post_author = %d 653 654 AND post_type = %s 654 AND post_status = %s";655 656 $query = $bbp_db->prepare( $sql, $user_id, bbp_get_reply_post_type() , bbp_get_public_status_id());655 AND post_status IN ({$statii})"; 656 657 $query = $bbp_db->prepare( $sql, $user_id, bbp_get_reply_post_type() ); 657 658 $count = (int) $bbp_db->get_var( $query ); 658 659
Note: See TracChangeset
for help on using the changeset viewer.