Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
bbPress 2.6.x: don't allow "bumped" topics to surface to the top.
* Order bbPress topic archives by post date (date created), not by last activity.
* This can be added either within a standalone plugin or to a theme's functions.php
* file.
* @param array $args
* @return array
add_filter( 'bbp_after_has_topics_parse_args', function( array $args ): array {
// Normally bbPress sorts topics by last active (which is stored as meta data). Undo this.
unset( $args['meta_key'], $args['meta_type'] );
// Default ordering is DESC, so all we typically need to do here is switch to ordering
// by post date (date created).
$args['orderby'] = 'date';
return $args;
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment