Changeset 4963
- Timestamp:
- 05/28/2013 05:55:08 PM (12 years ago)
- Location:
- trunk/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/admin/settings.php
r4950 r4963 170 170 ), 171 171 172 // Allow threadde replies 173 '_bbp_allow_threaded_replies' => array( 174 'sanitize_callback' => 'intval', 175 'args' => array() 176 ), 177 172 178 // Set reply threading level 173 179 '_bbp_thread_replies_depth' => array( 174 'title' => __( ' Thread replies to topics', 'bbpress' ),180 'title' => __( 'Reply Threading', 'bbpress' ), 175 181 'callback' => 'bbp_admin_setting_callback_thread_replies_depth', 176 182 'sanitize_callback' => 'intval', … … 526 532 // Set maximum depth for dropdown 527 533 $max_depth = (int) apply_filters( 'bbp_thread_replies_depth_max', 10 ); 528 $current_depth = bbp_thread_replies_depth(); ?> 534 $current_depth = bbp_thread_replies_depth(); 535 536 // Start an output buffer for the select dropdown 537 ob_start(); ?> 529 538 530 539 <select id="_bbp_thread_replies_depth" name="_bbp_thread_replies_depth"> 531 <?php for ( $i = 0; $i <= $max_depth; $i++ ) : ?>540 <?php for ( $i = 2; $i <= $max_depth; $i++ ) : ?> 532 541 533 542 <option value="<?php echo esc_attr( $i ); ?>" <?php selected( $i, $current_depth ); ?>><?php echo esc_html( $i ); ?></option> … … 536 545 </select> 537 546 538 <label for="_bbp_thread_replies_depth"><?php esc_html_e( 'levels deep', 'bbpress' ); ?></label> 547 <?php $select = ob_get_clean(); ?> 548 549 <label for="_bbp_allow_threaded_replies"> 550 <input name="_bbp_allow_threaded_replies" type="checkbox" id="_bbp_allow_threaded_replies" value="1" <?php checked( '1', bbp_allow_threaded_replies() ); ?> /> 551 <?php printf( esc_html__( 'Enable threaded (nested) replies %s levels deep', 'bbpress' ), $select ); ?> 552 </label> 539 553 540 554 <?php -
trunk/includes/core/options.php
r4947 r4963 30 30 /** Settings **********************************************************/ 31 31 32 '_bbp_edit_lock' => 5, // Lock post editing after 5 minutes 33 '_bbp_throttle_time' => 10, // Throttle post time to 10 seconds 34 '_bbp_enable_favorites' => 1, // Favorites 35 '_bbp_enable_subscriptions' => 1, // Subscriptions 36 '_bbp_allow_anonymous' => 0, // Allow anonymous posting 37 '_bbp_allow_global_access' => 1, // Users from all sites can post 38 '_bbp_allow_revisions' => 1, // Allow revisions 39 '_bbp_allow_topic_tags' => 1, // Topic Tags 40 '_bbp_thread_replies_depth' => 0, // Thread replies depth 41 '_bbp_use_wp_editor' => 1, // Use the WordPress editor if available 42 '_bbp_use_autoembed' => 0, // Allow oEmbed in topics and replies 43 '_bbp_theme_package_id' => 'default', // The ID for the current theme package 44 '_bbp_default_role' => bbp_get_participant_role(), // Default forums role 45 '_bbp_settings_integration' => 0, // Put settings into existing admin pages 32 '_bbp_edit_lock' => 5, // Lock post editing after 5 minutes 33 '_bbp_throttle_time' => 10, // Throttle post time to 10 seconds 34 '_bbp_enable_favorites' => 1, // Favorites 35 '_bbp_enable_subscriptions' => 1, // Subscriptions 36 '_bbp_allow_anonymous' => 0, // Allow anonymous posting 37 '_bbp_allow_global_access' => 1, // Users from all sites can post 38 '_bbp_allow_revisions' => 1, // Allow revisions 39 '_bbp_allow_topic_tags' => 1, // Topic Tags 40 '_bbp_allow_threaded_replies' => 0, // Allow threaded replies 41 '_bbp_thread_replies_depth' => 2, // Thread replies depth 42 '_bbp_use_wp_editor' => 1, // Use the WordPress editor if available 43 '_bbp_use_autoembed' => 0, // Allow oEmbed in topics and replies 44 '_bbp_theme_package_id' => 'default', // The ID for the current theme package 45 '_bbp_default_role' => bbp_get_participant_role(), // Default forums role 46 '_bbp_settings_integration' => 0, // Put settings into existing admin pages 46 47 47 48 /** Per Page **********************************************************/ … … 242 243 function bbp_thread_replies() { 243 244 $depth = bbp_thread_replies_depth(); 244 $retval = (bool) ( $depth > 1 ); 245 246 return (bool) apply_filters( 'bbp_thread_replies', $retval, $depth ); 245 $allow = bbp_allow_threaded_replies(); 246 $retval = (bool) ( ( $depth >= 2 ) && ( true === $allow ) ); 247 248 return (bool) apply_filters( 'bbp_thread_replies', $retval, $depth, $allow ); 249 } 250 251 /** 252 * Are threaded replies allowed 253 * 254 * @since bbPress (r4964) 255 * @param $default bool Optional. Default value false 256 * @uses get_option() To get the threaded replies setting 257 * @return bool Are threaded replies allowed? 258 */ 259 function bbp_allow_threaded_replies( $default = 0 ) { 260 return (bool) apply_filters( '_bbp_allow_threaded_replies', (bool) get_option( '_bbp_allow_threaded_replies', $default ) ); 247 261 } 248 262 … … 258 272 * @return int Thread replies depth 259 273 */ 260 function bbp_thread_replies_depth( $default = 1) {274 function bbp_thread_replies_depth( $default = 2 ) { 261 275 return (int) apply_filters( 'bbp_thread_replies_depth', (int) get_option( '_bbp_thread_replies_depth', $default ) ); 262 276 }
Note: See TracChangeset
for help on using the changeset viewer.