WordPress.org

Ready to get started?Download WordPress

Forums

bbPress Topics for Posts
[resolved] PHP: how to know if a post has "topics for posts" enabl (3 posts)

  1. kuching
    Member
    Posted 2 years ago #

    I wish to make the comment form appear on posts and custom post types posts only IF the "Topics for posts" plugin IS active and IF it has been set for that specific post. Ie, a specific post has been set to open a forum topic to replace its comments.

    To check if the plugin is active, it's easy (class_exists / function_exists), but I don't know what variable to look for to check if a post has "Topics for Posts" set.

    If not set, I don't want the comment box to appear at all, since I'm exclusively using forum threads/discussions to replace WP standard commenting system.

    Thanks

    http://wordpress.org/extend/plugins/bbpress-post-topics/

  2. David Dean
    Member
    Plugin Author

    Posted 2 years ago #

    A post with a topic set will have a postmeta entry called bbpress_discussion_topic_id.

    A simple check would be: if( ! empty( get_post_meta( $YOUR_POST_ID, 'bbpress_discussion_topic_id', true ) ) )

    Let me know how that works for you!

  3. kuching
    Member
    Posted 2 years ago #

    thanks :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic