Changeset 6246
- Timestamp:
- 01/16/2017 05:22:53 PM (7 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/core/options.php
r6078 r6246 272 272 273 273 /** 274 * Are replies threaded275 *276 * @since 2.4.0 bbPress (r4944)277 *278 * @param bool $default Optional. Default value true279 * @uses apply_filters() Calls 'bbp_thread_replies' with the calculated value and280 * the thread replies depth281 * @uses get_option() To get thread replies option282 * @return bool Are replies threaded?283 */284 function bbp_thread_replies() {285 $depth = bbp_thread_replies_depth();286 $allow = bbp_allow_threaded_replies();287 $retval = (bool) ( ( $depth >= 2 ) && ( true === $allow ) );288 289 return (bool) apply_filters( 'bbp_thread_replies', $retval, $depth, $allow );290 }291 292 /**293 274 * Are threaded replies allowed 294 275 * -
trunk/src/includes/replies/functions.php
r6224 r6246 2505 2505 2506 2506 /** 2507 * List replies 2507 * Are replies threaded? 2508 * 2509 * @since 2.4.0 bbPress (r4944) 2510 * @since 2.6.0 bbPress (r6245) Always false on user profile reply pages 2511 * 2512 * @param bool $default Optional. Default value true 2513 * @uses apply_filters() Calls 'bbp_thread_replies' with the calculated value and 2514 * the thread replies depth 2515 * @uses get_option() To get thread replies option 2516 * @return bool Are replies threaded? 2517 */ 2518 function bbp_thread_replies() { 2519 $depth = bbp_thread_replies_depth(); 2520 $allow = bbp_allow_threaded_replies(); 2521 2522 // Never thread replies on user profile pages. It looks weird, and we know 2523 // it is undesirable for the majority of installations. 2524 if ( bbp_is_single_user_replies() ) { 2525 $retval = false; 2526 } else { 2527 $retval = (bool) ( ( $depth >= 2 ) && ( true === $allow ) ); 2528 } 2529 2530 return (bool) apply_filters( 'bbp_thread_replies', $retval, $depth, $allow ); 2531 } 2532 2533 /** 2534 * List threaded replies 2508 2535 * 2509 2536 * @since 2.4.0 bbPress (r4944) -
trunk/src/includes/replies/template.php
r6228 r6246 2437 2437 */ 2438 2438 function bbp_topic_pagination_count() { 2439 echo bbp_get_topic_pagination_count();2439 echo esc_html( bbp_get_topic_pagination_count() ); 2440 2440 } 2441 2441 /** … … 2464 2464 2465 2465 // We are threading replies 2466 if ( bbp_thread_replies() && bbp_is_single_topic() ) { 2467 return; 2466 if ( bbp_thread_replies() ) { 2468 2467 $walker = new BBP_Walker_Reply; 2469 $threads = (int) $walker->get_number_of_root_elements( $bbp->reply_query->posts ); 2470 2471 // Adjust for topic 2472 $threads--; 2468 $threads = absint( $walker->get_number_of_root_elements( $bbp->reply_query->posts ) - 1 ); 2473 2469 $retstr = sprintf( _n( 'Viewing %1$s reply thread', 'Viewing %1$s reply threads', $threads, 'bbpress' ), bbp_number_format( $threads ) ); 2474 2470 … … 2499 2495 2500 2496 // Filter and return 2501 return apply_filters( 'bbp_get_topic_pagination_count', esc_html( $retstr ));2497 return apply_filters( 'bbp_get_topic_pagination_count', $retstr ); 2502 2498 } 2503 2499
Note: See TracChangeset
for help on using the changeset viewer.