Skip to content

Commit

Permalink
Coding Standards: Use strict comparisons in `wp-admin/options-discuss…
Browse files Browse the repository at this point in the history
…ion.php`.

See #53359.


git-svn-id: https://develop.svn.wordpress.org/trunk@51548 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
peterwilsoncc committed Aug 5, 2021
1 parent 3e6cd53 commit e776002
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wp-admin/options-discussion.php
Expand Up @@ -109,7 +109,7 @@
$thread_comments_depth = '</label> <label for="thread_comments_depth"><select name="thread_comments_depth" id="thread_comments_depth">';
for ( $i = 2; $i <= $maxdeep; $i++ ) {
$thread_comments_depth .= "<option value='" . esc_attr( $i ) . "'";
if ( get_option( 'thread_comments_depth' ) == $i ) {
if ( (int) get_option( 'thread_comments_depth' ) === $i ) {
$thread_comments_depth .= " selected='selected'";
}
$thread_comments_depth .= ">$i</option>";
Expand Down Expand Up @@ -256,7 +256,7 @@
'X' => __( 'X &#8212; Even more mature than above' ),
);
foreach ( $ratings as $key => $rating ) :
$selected = ( get_option( 'avatar_rating' ) == $key ) ? 'checked="checked"' : '';
$selected = ( get_option( 'avatar_rating' ) === $key ) ? 'checked="checked"' : '';
echo "\n\t<label><input type='radio' name='avatar_rating' value='" . esc_attr( $key ) . "' $selected/> $rating</label><br />";
endforeach;
?>
Expand Down Expand Up @@ -299,7 +299,7 @@
add_filter( 'pre_option_show_avatars', '__return_true', 100 );

foreach ( $avatar_defaults as $default_key => $default_name ) {
$selected = ( $default == $default_key ) ? 'checked="checked" ' : '';
$selected = ( $default === $default_key ) ? 'checked="checked" ' : '';
$avatar_list .= "\n\t<label><input type='radio' name='avatar_default' id='avatar_{$default_key}' value='" . esc_attr( $default_key ) . "' {$selected}/> ";
$avatar_list .= get_avatar( $user_email, 32, $default_key, '', array( 'force_default' => true ) );
$avatar_list .= ' ' . $default_name . '</label>';
Expand Down

0 comments on commit e776002

Please sign in to comment.