bbp_admin_setting_callback_show_on_root

Include root slug setting field.

Description

bbp_admin_setting_callback_show_on_root(); 

Usage

  1. if ( !function_exists( 'bbp_admin_setting_callback_show_on_root' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/admin/settings.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bbp_admin_setting_callback_show_on_root(); 
  7.  

Defined (1)

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

/includes/admin/settings.php  
  1. function bbp_admin_setting_callback_show_on_root() { 
  2.  
  3. // Current setting 
  4. $show_on_root = bbp_show_on_root(); 
  5.  
  6. // Options for forum root output 
  7. $root_options = array( 
  8. 'forums' => array( 
  9. 'name' => __( 'Forum Index', bbpress ) 
  10. ),  
  11. 'topics' => array( 
  12. 'name' => __( 'Topics by Freshness', bbpress ) 
  13. ); ?> 
  14.  
  15. <select name="_bbp_show_on_root" id="_bbp_show_on_root" <?php bbp_maybe_admin_setting_disabled( '_bbp_show_on_root' ); ?>> 
  16.  
  17. <?php foreach ( $root_options as $option_id => $details ) : ?> 
  18.  
  19. <option <?php selected( $show_on_root, $option_id ); ?> value="<?php echo esc_attr( $option_id ); ?>"><?php echo esc_html( $details['name'] ); ?></option> 
  20.  
  21. <?php endforeach; ?> 
  22.  
  23. </select> 
  24.  
  25. <?php