From bc7cc3bb12b0d628faef9f5225d98c04ea1e6cc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helen=20Hou-Sand=C3=AD?= Date: Thu, 8 Jan 2015 17:01:24 +0000 Subject: [PATCH] Collapse additional avatar settings if avatars are disabled. props markjaquith, krogsgard, valendesigns. fixes #30168. Built from https://develop.svn.wordpress.org/trunk@31095 git-svn-id: http://core.svn.wordpress.org/trunk@31076 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/options-discussion.php | 39 +++++++++++++++++++++++++++++---- wp-includes/version.php | 2 +- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/wp-admin/options-discussion.php b/wp-admin/options-discussion.php index c9c8627e65..18e3b3d3bd 100644 --- a/wp-admin/options-discussion.php +++ b/wp-admin/options-discussion.php @@ -14,6 +14,26 @@ if ( ! current_user_can( 'manage_options' ) ) $title = __('Discussion Settings'); $parent_file = 'options-general.php'; +/** + * Display JavaScript on the page. + * + * @since 4.2.0 + */ +function options_discussion_add_js() { +?> + +add_help_tab( array( 'id' => 'overview', 'title' => __('Overview'), @@ -172,19 +192,23 @@ printf( __('Comments should be displayed with the %s comments at the top of each

- + - + - +
@@ -207,7 +231,7 @@ endforeach;
@@ -239,6 +263,10 @@ if ( empty($default) ) $default = 'mystery'; $size = 32; $avatar_list = ''; + +// Force avatars on to display these choices +add_filter( 'pre_option_show_avatars', '__return_true', 100 ); + foreach ( $avatar_defaults as $default_key => $default_name ) { $selected = ($default == $default_key) ? 'checked="checked" ' : ''; $avatar_list .= "\n\t'; $avatar_list .= '
'; } + +remove_filter( 'pre_option_show_avatars', '__return_true', 100 ); + /** * Filter the HTML output of the default avatar list. * diff --git a/wp-includes/version.php b/wp-includes/version.php index 6c186dc044..e9ced50e7b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31094'; +$wp_version = '4.2-alpha-31095'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.