From 854ea3e3e68f766669f701c648d7ccfe59bc2f94 Mon Sep 17 00:00:00 2001 From: Helen Hou-Sandi Date: Thu, 8 Jan 2015 17:00:15 +0000 Subject: [PATCH] Collapse additional avatar settings if avatars are disabled. props markjaquith, krogsgard, valendesigns. fixes #30168. git-svn-id: https://develop.svn.wordpress.org/trunk@31095 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/options-discussion.php | 39 ++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/src/wp-admin/options-discussion.php b/src/wp-admin/options-discussion.php index c9c8627e65..18e3b3d3bd 100644 --- a/src/wp-admin/options-discussion.php +++ b/src/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. *