bpbbpst_get_selected_support_status

Gets the selected status from the list of available ones.

Description

(array) bpbbpst_get_selected_support_status( (int) $selected = 0 ); 

Returns (array)

the selected status with arguments

Parameters (1)

0. $selected — Optional. (int)
The value of the support status

Usage

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

Defined (1)

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

/includes/functions.php  
  1. function bpbbpst_get_selected_support_status( $selected = 0 ) { 
  2.  
  3. $selected_status = array(); 
  4.  
  5. $all_status = bpbbpst_get_support_status(); 
  6.  
  7. foreach ( $all_status as $key => $status ) { 
  8.  
  9. if ( $status['value'] == $selected ) { 
  10. $selected_status = $all_status[$key]; 
  11. $selected_status = array_merge( $selected_status, array( 'class' => $key ) ); 
  12.  
  13. return $selected_status;