WordPress.org

Making WordPress.org

Changeset 3985


Ignore:
Timestamp:
09/07/2016 01:47:19 PM (5 years ago)
Author:
jmdodd
Message:

Support Forums: Allow filtering on topic resolution to only display on relevant forums.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-topic-resolution/inc/class-plugin.php

    r3905 r3985  
    6565     */
    6666    public function get_topic_title( $title, $topic_id ) {
     67        // Only run when enabled on a topic's forum.
     68        if ( ! $this->is_enabled_on_forum( bbp_get_topic_forum_id( $topic_id ) ) ) {
     69            return $title;
     70        }
     71
    6772        $resolved = __( 'Resolved', 'wporg-forums' );
    6873        if ( 'yes' == $this->get_topic_resolution( array( 'id' => $topic_id ) ) ) {
     
    328333
    329334    public function is_enabled_on_forum( $forum_id = 0 ) {
    330         // @todo Make this actually check the option; for testing, 'true' is okay
    331         return true;
    332 
    333         $forum = bbp_get_forum( $forum_id );
    334         if ( empty( $forum ) ) {
    335             return;
    336         }
    337 
    338         $enabled = $this->get_enabled_forums();
    339         if ( $enabled && in_array( $forum_id, $enabled ) ) {
    340             return true;
    341         }
    342         return false;
     335        return apply_filters( 'wporg_bbp_topic_resolution_is_enabled_on_forum', true, $forum_id );
    343336    }
    344337
Note: See TracChangeset for help on using the changeset viewer.