bbp_admin_setting_callback_thread_replies_depth

Hierarchical reply maximum depth level setting field.

Description

bbp_admin_setting_callback_thread_replies_depth(); 

Replies will be threaded if depth is 2 or greater


Usage

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

Defined (1)

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

/includes/admin/settings.php  
  1. function bbp_admin_setting_callback_thread_replies_depth() { 
  2.  
  3. // Set maximum depth for dropdown 
  4. $max_depth = (int) apply_filters( 'bbp_thread_replies_depth_max', 10 ); 
  5. $current_depth = bbp_thread_replies_depth(); 
  6.  
  7. // Start an output buffer for the select dropdown 
  8. ob_start(); ?> 
  9.  
  10. </label> 
  11. <label for="_bbp_thread_replies_depth"> 
  12. <select name="_bbp_thread_replies_depth" id="_bbp_thread_replies_depth" <?php bbp_maybe_admin_setting_disabled( '_bbp_thread_replies_depth' ); ?>> 
  13. <?php for ( $i = 2; $i <= $max_depth; $i++ ) : ?> 
  14.  
  15. <option value="<?php echo esc_attr( $i ); ?>" <?php selected( $i, $current_depth ); ?>><?php echo esc_html( $i ); ?></option> 
  16.  
  17. <?php endfor; ?> 
  18. </select> 
  19.  
  20. <?php $select = ob_get_clean(); ?> 
  21.  
  22. <label for="_bbp_allow_threaded_replies"> 
  23. <input name="_bbp_allow_threaded_replies" id="_bbp_allow_threaded_replies" type="checkbox" value="1" <?php checked( '1', bbp_allow_threaded_replies( false ) ); bbp_maybe_admin_setting_disabled( '_bbp_allow_threaded_replies' ); ?> /> 
  24. <?php printf( esc_html__( 'Enable threaded (nested) replies %s levels deep', bbpress ), $select ); ?> 
  25. </label> 
  26.  
  27. <?php