bbp_admin_setting_callback_subtheme_id

Use the WordPress editor setting field.

Description

bbp_admin_setting_callback_subtheme_id(); 

Usage

  1. if ( !function_exists( 'bbp_admin_setting_callback_subtheme_id' ) ) { 
  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_subtheme_id(); 
  7.  

Defined (1)

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

/includes/admin/settings.php  
  1. function bbp_admin_setting_callback_subtheme_id() { 
  2.  
  3. // Declare locale variable 
  4. $theme_options = ''; 
  5. $current_package = bbp_get_theme_package_id( 'default' ); 
  6.  
  7. // Note: This should never be empty. /templates/ is the 
  8. // canonical backup if no other packages exist. If there's anerrorhere,  
  9. // something else is wrong. 
  10. // 
  11. // @see bbPress::register_theme_packages() 
  12. foreach ( (array)bbpress)->theme_compat->packages as $id => $theme ) { 
  13. $theme_options .= '<option value="' . esc_attr( $id ) . '"' . selected( $theme->id, $current_package, false ) . '>' . sprintf( esc_html__( '%1$s - %2$s', bbpress ), esc_html( $theme->name ), esc_html( str_replace( WP_CONTENT_DIR, '', $theme->dir ) ) ) . '</option>'; 
  14.  
  15. if ( !empty( $theme_options ) ) : ?> 
  16.  
  17. <select name="_bbp_theme_package_id" id="_bbp_theme_package_id" <?php bbp_maybe_admin_setting_disabled( '_bbp_theme_package_id' ); ?>><?php echo $theme_options ?></select> 
  18. <label for="_bbp_theme_package_id"><?php esc_html_e( 'will serve all bbPress templates', bbpress ); ?></label> 
  19.  
  20. <?php else : ?> 
  21.  
  22. <p><?php esc_html_e( 'No template packages available.', bbpress ); ?></p> 
  23.  
  24. <?php endif;