Skip to:
Content
Pages
Categories
Search
Top
Bottom

Recently edited replies to the top


  • project_subdomain
    Participant

    @project_subdomain

    I’m using descending post order (newest replies first with plugin bbpress – sort topic replies) but would like recently edited replies of some forum also to go first.

    Any tips on how to get this to work? Or is there a plugin that allows user to push their replies to the top?

Viewing 3 replies - 1 through 3 (of 3 total)

  • Robkk
    Moderator

    @robkk

    I think using something like this would work for what you want.

    function custom_bbp_has_replies() {
        $args['orderby'] = 'post_modified';
        $args['order'] = 'DESC';
        return $args;
    }
    add_filter('bbp_before_has_replies_parse_args', 'custom_bbp_has_replies' );

    project_subdomain
    Participant

    @project_subdomain

    thanks, robkk, works like a charm!


    project_subdomain
    Participant

    @project_subdomain

    to prevent showing all users’ replies in ‘my replies’ this code works instead, which robkk wrote:

    function custom_bbp_has_replies( $args ) { 
        if ( bbp_is_single_topic() && !bbp_is_single_user() ) { 
            $args['orderby'] .= 'post_modified';
            $args['order'] .= 'DESC';
        } 
        return $args; 
    } 
    add_filter('bbp_before_has_replies_parse_args', 'custom_bbp_has_replies' );
Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.