Skip to:
Content
Pages
Categories
Search
Top
Bottom

Mark topic as closed


  • on3advertising
    Participant

    @on3advertising

    I want to customize a topic that is closed. It was easy to find the css class for a topic that was closed, but I cannot for for the life of me find what php file is executing that class. I want to add an extra column with the string “[Resolved]” next to the name of the topic to make it more intuitive for my users. The website with an example of a closed topic is: http://www.compusoftdevelopment.com/forum/forums/forum/submitted-features/

    I am running Wp v3.4.2 and bbPress v2.1.2

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

  • zaerl
    Participant

    @zaerl

    The class is “status-closed”. You can change the title of a topic in this way:

    add_filter('the_title', 'custom_the_title', 10, 2);
    
    public function custom_the_title($title, $post_id) {
        if(get_post_type($post_id) === bbp_get_topic_post_type() &&
            bbp_is_topic_closed($post_id)) {
            return '[Resolved] ' . $title;
        }
    
        return $title;
    }
    
    • This reply was modified 11 years, 6 months ago by zaerl.
    • This reply was modified 11 years, 6 months ago by zaerl.

    zaerl
    Participant

    @zaerl

    Forgot the double &, it’s &&.


    on3advertising
    Participant

    @on3advertising

    Zaerl, you rock. Thank you for that. Except I think you actually did include the double ampersand in your original source.


    on3advertising
    Participant

    @on3advertising

    Never mind I just noticed you modified your post 🙂


    zaerl
    Participant

    @zaerl

    Unfortunately this forum has a lot of problems with HTML entities.


    weezies
    Participant

    @weezies

    Hello. Can you please advise which file the code above needs to be inserted in? I can definitely use this functionality. I’ve tried adding it in my theme’s functions.php but it doesn’t work there. Thank you!

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar