bpbbpst_new_support_topic_notify

Hooks bbp_new_topic to eventually send a notification to moderators.

Description

bpbbpst_new_support_topic_notify( (int) $topic_id = 0, (int) $forum_id = 0, (constant) $anonymous_data = false, (int) $topic_author = 0 ); 

Parameters (4)

0. $topic_id — Optional. (int)
The topic id just created
1. $forum_id — Optional. (int)
The forum id the topic is attached to
2. $anonymous_data — Optional. (constant) => false
The anonymous data.
3. $topic_author — Optional. (int)
The topic author id

Usage

  1. if ( !function_exists( 'bpbbpst_new_support_topic_notify' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddy-bbpress-support-topic/includes/functions.php'; 
  3.  
  4. // the topic id just created 
  5. $topic_id = -1; 
  6.  
  7. // the forum id the topic is attached to 
  8. $forum_id = -1; 
  9.  
  10. // The anonymous data. 
  11. $anonymous_data = false; 
  12.  
  13. // the topic author id 
  14. $topic_author = -1; 
  15.  
  16. // NOTICE! Understand what this does before running. 
  17. $result = bpbbpst_new_support_topic_notify($topic_id, $forum_id, $anonymous_data, $topic_author); 
  18.  

Defined (1)

The function is defined in the following location(s).

/includes/functions.php  
  1. function bpbbpst_new_support_topic_notify( $topic_id = 0, $forum_id = 0, $anonymous_data = false, $topic_author = 0 ) { 
  2.  
  3. if ( empty( $topic_id ) ) { 
  4. return; 
  5.  
  6. if ( empty( $forum_id ) ) { 
  7. return; 
  8.  
  9. $forum_support_feature = bpbbpst_get_forum_support_setting( $forum_id ); 
  10.  
  11. if ( $forum_support_feature != 3 && ! empty( $_POST['_bp_bbp_st_is_support'] ) ) { 
  12. bpbbpst_notify_moderators( $topic_id, $forum_id, $anonymous_data, $topic_author );