Changeset 3325 for branches/plugin/bbp-includes/bbp-reply-template.php
- Timestamp:
- 06/13/2011 07:21:03 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-includes/bbp-reply-template.php
r3324 r3325 87 87 88 88 // What are the default allowed statuses (based on user caps) 89 if ( !empty( $_GET['view'] ) && ( 'all' == $_GET['view'] && current_user_can( 'edit_others_replies' )) )89 if ( bbp_get_view_all( 'edit_others_replies' ) ) 90 90 $default_status = join( ',', array( 'publish', $bbp->closed_status_id, $bbp->spam_status_id, 'trash' ) ); 91 91 } … … 162 162 'next_text' => '→', 163 163 'mid_size' => 1, 164 'add_args' => ( !empty( $_GET['view'] ) && 'all' == $_GET['view']) ? array( 'view' => 'all' ) : false164 'add_args' => ( bbp_get_view_all() ) ? array( 'view' => 'all' ) : false 165 165 ) ); 166 166 … … 344 344 * 345 345 * @param int $reply_id Optional. Reply id 346 * @param bool $count_hidden Optional. Count hidden (trashed/spammed)347 * replies? If $_GET['view'] == all, it is348 * automatically set to true. To override349 * this, set $count_hidden = (int) -1350 346 * @param $string $redirect_to Optional. Pass a redirect value for use with 351 347 * shortcodes and other fun things. … … 362 358 * @return string Link to reply relative to paginated topic 363 359 */ 364 function bbp_get_reply_url( $reply_id = 0, $ count_hidden = false, $redirect_to = '' ) {360 function bbp_get_reply_url( $reply_id = 0, $redirect_to = '' ) { 365 361 global $bbp, $wp_rewrite; 366 362 367 363 // Set needed variables 368 $reply_id = bbp_get_reply_id ( $reply_id );369 $topic_id = bbp_get_reply_topic_id ( $reply_id );370 $topic_url = bbp_get_topic_permalink( $topic_id, $redirect_to );371 $reply_position = bbp_get_reply_position ( $reply_id, $topic_id 364 $reply_id = bbp_get_reply_id ( $reply_id ); 365 $topic_id = bbp_get_reply_topic_id ( $reply_id ); 366 $topic_url = bbp_get_topic_permalink( $topic_id, $redirect_to ); 367 $reply_position = bbp_get_reply_position ( $reply_id, $topic_id ); 372 368 373 369 // Check if in query with pagination … … 397 393 } 398 394 399 return apply_filters( 'bbp_get_reply_url', $url, $reply_id, $count_hidden ); 395 // Add topic view query arg back to end if it is set 396 if ( bbp_get_view_all() ) 397 $url = bbp_add_view_all( $url ); 398 399 return apply_filters( 'bbp_get_reply_url', $url, $reply_id, $redirect_to ); 400 400 } 401 401 … … 1180 1180 if ( $reply_count = bbp_get_topic_reply_count( $topic_id ) ) { 1181 1181 1182 // Are we counting hidden replies too? 1183 if ( bbp_get_view_all() ) 1184 $topic_replies = bbp_get_all_child_ids ( $topic_id, bbp_get_reply_post_type() ); 1185 else 1186 $topic_replies = bbp_get_public_child_ids( $topic_id, bbp_get_reply_post_type() ); 1187 1182 1188 // Get reply id's 1183 if ( $topic_replies = bbp_get_public_child_ids( $topic_id, bbp_get_reply_post_type()) ) {1189 if ( !empty( $topic_replies ) ) { 1184 1190 1185 1191 // Reverse replies array and search for current reply position
Note: See TracChangeset
for help on using the changeset viewer.