bpbbpst_neutralize_not_support

Eventually unsets the not a support questions for support only forums.

Description

(array) bpbbpst_neutralize_not_support( (array) $all_status = array() ); 

Returns (array)

the statuses without the not a support question if needed

Parameters (1)

0. $all_status — Optional. (array) => array()
The registered support statuses

Usage

  1. if ( !function_exists( 'bpbbpst_neutralize_not_support' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddy-bbpress-support-topic/includes/functions.php'; 
  3.  
  4. // the registered support statuses 
  5. $all_status = array(); 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bpbbpst_neutralize_not_support($all_status); 
  9.  

Defined (1)

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

/includes/functions.php  
  1. function bpbbpst_neutralize_not_support( $all_status = array() ) { 
  2.  
  3. $topic_id = bbp_get_topic_id(); 
  4.  
  5. if ( is_admin() && empty( $topic_id ) && isset( get_current_screen()->post_type ) && get_current_screen()->post_type == bbp_get_topic_post_type() && get_current_screen()->base == 'post' ) { 
  6. $topic_id = get_the_ID(); 
  7.  
  8. if ( empty( $topic_id ) ) { 
  9. return $all_status; 
  10.  
  11. $forum_id = bbp_get_topic_forum_id( $topic_id ); 
  12.  
  13. if ( empty( $forum_id ) ) { 
  14. return $all_status; 
  15.  
  16. if ( 2 == bpbbpst_get_forum_support_setting( $forum_id ) && ! empty( $all_status['topic-not-support'] ) ) { 
  17. unset( $all_status['topic-not-support'] ); 
  18.  
  19. return $all_status;