From a131ad469ed7d1e7987264d63a5f9371a0430d47 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Tue, 22 Sep 2009 06:00:46 +0000 Subject: [PATCH] Eliminate the redundant and confusing comment threading depth of 1. Threading starts at 2 now. fixes #10829 git-svn-id: http://svn.automattic.com/wordpress/trunk@11958 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/upgrade.php | 20 ++++++++++++++++++++ wp-admin/options-discussion.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 090ef1a63..06c0ff894 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -346,6 +346,9 @@ function upgrade_all() { if ( $wp_current_db_version < 10360 ) upgrade_280(); + if ( $wp_current_db_version < 11958 ) + upgrade_290(); + maybe_disable_automattic_widgets(); update_option( 'db_version', $wp_db_version ); @@ -983,6 +986,23 @@ function upgrade_280() { populate_roles_280(); } +/** + * Execute changes made in WordPress 2.9. + * + * @since 2.9.0 + */ +function upgrade_290() { + global $wp_current_db_version; + + if ( $wp_current_db_version < 11958 ) { + // Previously, setting depth to 1 would redundantly disable threading, but now 2 is the minimum depth to avoid confusion + if ( get_option( 'thread_comments_depth' ) == '1' ) { + update_option( 'thread_comments_depth', 2 ); + update_option( 'thread_comments', 0 ); + } + } +} + // The functions we use to actually do stuff diff --git a/wp-admin/options-discussion.php b/wp-admin/options-discussion.php index f6cc7747f..8093d1593 100644 --- a/wp-admin/options-discussion.php +++ b/wp-admin/options-discussion.php @@ -66,7 +66,7 @@ include('admin-header.php'); $maxdeep = (int) apply_filters( 'thread_comments_depth_max', 10 ); $thread_comments_depth = '