~canonical-sysadmins/wordpress/4.8.1

« back to all changes in this revision

Viewing changes to wp-admin/options-discussion.php

  • Committer: Barry Price
  • Date: 2016-08-17 04:50:12 UTC
  • mfrom: (1.1.18 upstream)
  • Revision ID: barry.price@canonical.com-20160817045012-qfui81zhqnqv2ba9
Merge WP4.6 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
require_once( dirname( __FILE__ ) . '/admin.php' );
10
10
 
11
11
if ( ! current_user_can( 'manage_options' ) )
12
 
        wp_die( __( 'You do not have sufficient permissions to manage options for this site.' ) );
 
12
        wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
13
13
 
14
14
$title = __('Discussion Settings');
15
15
$parent_file = 'options-general.php';
78
78
<input name="thread_comments" type="checkbox" id="thread_comments" value="1" <?php checked('1', get_option('thread_comments')); ?> />
79
79
<?php
80
80
/**
81
 
 * Filter the maximum depth of threaded/nested comments.
 
81
 * Filters the maximum depth of threaded/nested comments.
82
82
 *
83
83
 * @since 2.7.0.
84
84
 *
195
195
 
196
196
<?php
197
197
$ratings = array(
198
 
        /* translators: Content suitability rating: http://bit.ly/89QxZA */
 
198
        /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
199
199
        'G' => __('G &#8212; Suitable for all audiences'),
200
 
        /* translators: Content suitability rating: http://bit.ly/89QxZA */
 
200
        /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
201
201
        'PG' => __('PG &#8212; Possibly offensive, usually for audiences 13 and above'),
202
 
        /* translators: Content suitability rating: http://bit.ly/89QxZA */
 
202
        /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
203
203
        'R' => __('R &#8212; Intended for adult audiences above 17'),
204
 
        /* translators: Content suitability rating: http://bit.ly/89QxZA */
 
204
        /* translators: Content suitability rating: https://en.wikipedia.org/wiki/Motion_Picture_Association_of_America_film_rating_system */
205
205
        'X' => __('X &#8212; Even more mature than above')
206
206
);
207
207
foreach ($ratings as $key => $rating) :
229
229
        'retro' => __('Retro (Generated)')
230
230
);
231
231
/**
232
 
 * Filter the default avatars.
 
232
 * Filters the default avatars.
233
233
 *
234
234
 * Avatars are stored in key/value pairs, where the key is option value,
235
235
 * and the name is the displayed avatar name.
240
240
 */
241
241
$avatar_defaults = apply_filters( 'avatar_defaults', $avatar_defaults );
242
242
$default = get_option( 'avatar_default', 'mystery' );
243
 
$size = 32;
244
243
$avatar_list = '';
245
244
 
246
245
// Force avatars on to display these choices
249
248
foreach ( $avatar_defaults as $default_key => $default_name ) {
250
249
        $selected = ($default == $default_key) ? 'checked="checked" ' : '';
251
250
        $avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='" . esc_attr($default_key) . "' {$selected}/> ";
252
 
 
253
 
        $avatar = get_avatar( $user_email, $size, $default_key );
254
 
        $avatar = preg_replace( "/src='(.+?)'/", "src='\$1&amp;forcedefault=1'", $avatar );
255
 
        $avatar = preg_replace( "/srcset='(.+?) 2x'/", "srcset='\$1&amp;forcedefault=1 2x'", $avatar );
256
 
        $avatar_list .= $avatar;
257
 
 
 
251
        $avatar_list .= get_avatar( $user_email, 32, $default_key, '', array( 'force_default' => true ) );
258
252
        $avatar_list .= ' ' . $default_name . '</label>';
259
253
        $avatar_list .= '<br />';
260
254
}
262
256
remove_filter( 'pre_option_show_avatars', '__return_true', 100 );
263
257
 
264
258
/**
265
 
 * Filter the HTML output of the default avatar list.
 
259
 * Filters the HTML output of the default avatar list.
266
260
 *
267
261
 * @since 2.6.0
268
262
 *