Skip to:
Content
Pages
Categories
Search
Top
Bottom

Variables Available for bb_new_topic

  • @jennygold

    Member

    I’m trying to use the function bb_new_topic with the Post Notification plugin to send out an email when a new topic has been posted. The plugin as written by the author uses bb_new_post to notify of new posts, which has access to the topic ID via get_topic($topic_id) to pass in the title, author, and link of the post to the email. This variable doesn’t seem to be available with bb_new_topic. How can I get the title, link, and author to be passed into the email? I’m not sure what variables are available.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • @sambauers

    Participant

    bb_new_topic() just calls bb_insert_topic(), at the end of bb_insert_topic() is a do_action() call called ‘bb_insert_topic’ which has available to it all the information you need. The only thing you need to remember to do is differentiate between new and edited topics as both are handled by that function.

    @jennygold

    Member

    Thanks. I looked up that function and see that the topic id gets returned, but it’s still not working. Maybe I’m not understanding what to do. I’m now trying to use:

    add_action(‘bb_insert_topic’, ‘notification_new_topic’);

    The idea is that when a new topic is inserted, my function ‘notification_new_topic’ gets executed where I need access to the topic id, but it’s not getting returned with get_topic($topic_id);

    Am I doing this correctly?

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