Skip to:
Content

bbPress.org


Ignore:
Timestamp:
01/16/2017 05:22:53 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Replies: Update bbp_thread_replies() to skip user profile pages.

  • Move from core/options to replies/functions, since this isn't directly an option
  • Add ! bbp_is_single_user_replies() check to force false if so
  • Update threaded replies pagination to re-include verbiage.

Fixes #3002.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/replies/functions.php

    r6224 r6246  
    25052505
    25062506/**
    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 */
     2518function 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
    25082535 *
    25092536 * @since 2.4.0 bbPress (r4944)
Note: See TracChangeset for help on using the changeset viewer.