Add “Resolved” to Closed Topics in bbPress

Since Margot’s been born, I’ve been having a hard time wrapping my brain around anything other than being a dad to her and her older sister Abby. I forgot about writing anything in May and thought I should at least put something up, even if it isn’t too elaborate.
I know there are probably better ways to accomplish displaying a topic in bbPress as resolved, but I didn’t want to go into adding any additional functionality. In the end, all I did was hook into bbp_theme_before_topic_title to check to see if the topic is closed. If it is, add “Resolved” before the title.
Here’s the code:

add_action( 'bbp_theme_before_topic_title', 'bavotasan_resolved_topics' );
/**
 * Add "Resolved" to closed topics
 *
 * This function is attached to the 'bbp_theme_before_topic_title' action hook.
 * @author c.bavota
 */
function bavotasan_resolved_topics() {
   $topic_id = bbp_get_topic_id();
   if ( get_post_type( $topic_id ) == bbp_get_topic_post_type() && bbp_is_topic_closed( $topic_id ) )
      echo '[Resolved]';
}

I use Font Awesome on my theme site and wanted a little icon before the resolved text so my actual code for the echoed line looks like this:

echo ' [Resolved]';

It’s a simple mod for bbPress that makes it easier to see which topics have actually been closed. And by closed I mean resolved. 😉

Share this:

Email
Facebook
Twitter
Pinterest
Pocket

Premium Themes for WordPress

Looking for an easy-to-use Premium Theme for WordPress? Check out Themes by bavotasan.com and have your site up and running in no time.

Use this WordPress website builder to build powerful websites in no time for your or your clients.

WordPress Hosting

WP Engine – designed from the ground-up to support and enhance the workflow of web designers.

Bluehost – providing quality web hosting solutions since 1996.

About the author

Picture of Luke Perrie

Luke Perrie