bpbbpst_display_forum_setting_options

Displays the available 3 options for forum support settings.

Description

(string) bpbbpst_display_forum_setting_options( (int) $support_feature = 1 ); 

Returns (string)

html list of options

Parameters (1)

0. $support_feature — Optional. (int) => 1
The previously saved option if any

Usage

  1. if ( !function_exists( 'bpbbpst_display_forum_setting_options' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddy-bbpress-support-topic/includes/functions.php'; 
  3.  
  4. // the previously saved option if any 
  5. $support_feature = 1; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = bpbbpst_display_forum_setting_options($support_feature); 
  9.  

Defined (1)

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

/includes/functions.php  
  1. function bpbbpst_display_forum_setting_options( $support_feature = 1 ) { 
  2. $forum_support_settings = apply_filters( 'bpbbpst_forum_support_settings', array( 
  3. 'bpbbpst_forum_settings_yes' => array( 
  4. 'value' => 1,  
  5. 'label' => __( 'Leave users mark topics of this forum as support ones', 'buddy-bbpress-support-topic' ) 
  6. ),  
  7. 'bpbbpst_forum_settings_only' => array( 
  8. 'value' => 2,  
  9. 'label' => __( 'This forum is dedicated to support, all topics will be marked as support ones.', 'buddy-bbpress-support-topic' ) 
  10. ),  
  11. 'bpbbpst_forum_settings_no' => array( 
  12. 'value' => 3,  
  13. 'label' => __( 'This forum does not accept support topics', 'buddy-bbpress-support-topic' ) 
  14. ),  
  15. ) ); 
  16.  
  17. if ( empty( $forum_support_settings ) ) { 
  18. return; 
  19. ?> 
  20. <ul class="forum-support-settings"> 
  21.  
  22. <?php foreach ( $forum_support_settings as $key_setting => $setting ) : ?> 
  23.  
  24. <?php if ( empty( $key_setting ) || empty( $setting['value'] ) || empty( $setting['label'] ) ) : continue ; endif ;?> 
  25.  
  26. <li> 
  27. <input type="radio" name="_bpbbpst_forum_settings" id="<?php echo esc_attr( $key_setting );?>" value="<?php echo esc_attr( $setting['value'] );?>" <?php checked( intval( $setting['value'] ), $support_feature );?>/> 
  28. <?php echo esc_html( $setting['label'] ); ?> 
  29. </li> 
  30.  
  31. <?php endforeach ;?> 
  32. </ul> 
  33. <?php