Skip to:
Content
Pages
Categories
Search
Top
Bottom

Recently edited replies to the top

  • @project_subdomain

    Participant

    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

    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

    thanks, robkk, works like a charm!

    @project_subdomain

    Participant

    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.
Skip to toolbar