bbp_admin_setting_callback_thread_replies_depth()
Hierarchical reply maximum depth level setting field
Description Description
Replies will be threaded if depth is 2 or greater
Source Source
File: includes/admin/settings.php
function bbp_admin_setting_callback_thread_replies_depth() { // Set maximum depth for dropdown $max_depth = (int) apply_filters( 'bbp_thread_replies_depth_max', 10 ); $current_depth = bbp_thread_replies_depth(); // Start an output buffer for the select dropdown ob_start(); ?> </label> <label for="_bbp_thread_replies_depth"> <select name="_bbp_thread_replies_depth" id="_bbp_thread_replies_depth" <?php bbp_maybe_admin_setting_disabled( '_bbp_thread_replies_depth' ); ?>> <?php for ( $i = 2; $i <= $max_depth; $i++ ) : ?> <option value="<?php echo esc_attr( $i ); ?>" <?php selected( $i, $current_depth ); ?>><?php echo esc_html( $i ); ?></option> <?php endfor; ?> </select> <?php $select = ob_get_clean(); ?> <label for="_bbp_allow_threaded_replies"> <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' ); ?> /> <?php printf( esc_html__( 'Enable threaded (nested) replies %s levels deep', 'bbpress' ), $select ); ?> </label> <?php }
Changelog Changelog
Version | Description |
---|---|
2.4.0 | Introduced. |