diff --git a/src/wp-includes/class-wp-xmlrpc-server.php b/src/wp-includes/class-wp-xmlrpc-server.php
index 53a04162be..ca8d2c1287 100644
--- a/src/wp-includes/class-wp-xmlrpc-server.php
+++ b/src/wp-includes/class-wp-xmlrpc-server.php
@@ -3254,7 +3254,7 @@ class wp_xmlrpc_server extends IXR_Server {
$status = wp_delete_comment( $comment_ID );
- if ( true == $status ) {
+ if ( $status ) {
/**
* Fires after a comment has been successfully deleted via XML-RPC.
*
diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php
index dbf63ef1dc..1945c6738f 100644
--- a/src/wp-includes/general-template.php
+++ b/src/wp-includes/general-template.php
@@ -1645,7 +1645,7 @@ function get_calendar($initial = true, $echo = true) {
}
foreach ( $myweek as $wd ) {
- $day_name = (true == $initial) ? $wp_locale->get_weekday_initial($wd) : $wp_locale->get_weekday_abbrev($wd);
+ $day_name = $initial ? $wp_locale->get_weekday_initial($wd) : $wp_locale->get_weekday_abbrev($wd);
$wd = esc_attr($wd);
$calendar_output .= "\n\t\t
$day_name | ";
}
diff --git a/src/wp-includes/kses.php b/src/wp-includes/kses.php
index df8bed7028..637fac4627 100644
--- a/src/wp-includes/kses.php
+++ b/src/wp-includes/kses.php
@@ -1461,8 +1461,9 @@ function kses_remove_filters() {
function kses_init() {
kses_remove_filters();
- if (current_user_can('unfiltered_html') == false)
+ if ( ! current_user_can( 'unfiltered_html' ) ) {
kses_init_filters();
+ }
}
/**
diff --git a/src/wp-includes/ms-deprecated.php b/src/wp-includes/ms-deprecated.php
index beae326fe1..5b6702090b 100644
--- a/src/wp-includes/ms-deprecated.php
+++ b/src/wp-includes/ms-deprecated.php
@@ -210,7 +210,7 @@ function get_most_active_blogs( $num = 10, $display = true ) {
$most_active = $t;
}
- if ( $display == true ) {
+ if ( $display ) {
if ( is_array( $most_active ) ) {
reset( $most_active );
foreach ( (array) $most_active as $key => $details ) {
@@ -253,7 +253,7 @@ function wpmu_admin_do_redirect( $url = '' ) {
wp_redirect( $ref );
exit();
}
- if ( empty( $_SERVER['HTTP_REFERER'] ) == false ) {
+ if ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {
wp_redirect( $_SERVER['HTTP_REFERER'] );
exit();
}
diff --git a/src/wp-includes/ms-functions.php b/src/wp-includes/ms-functions.php
index a29cecd011..89f9ff1b14 100644
--- a/src/wp-includes/ms-functions.php
+++ b/src/wp-includes/ms-functions.php
@@ -481,11 +481,11 @@ function wpmu_validate_user_signup($user_name, $user_email) {
$errors->add('user_name', __( 'Please enter a username.' ) );
$illegal_names = get_site_option( 'illegal_names' );
- if ( is_array( $illegal_names ) == false ) {
+ if ( ! is_array( $illegal_names ) ) {
$illegal_names = array( 'www', 'web', 'root', 'admin', 'main', 'invite', 'administrator' );
add_site_option( 'illegal_names', $illegal_names );
}
- if ( in_array( $user_name, $illegal_names ) == true )
+ if ( in_array( $user_name, $illegal_names ) )
$errors->add('user_name', __( 'That username is not allowed.' ) );
if ( is_email_address_unsafe( $user_email ) )
@@ -505,10 +505,11 @@ function wpmu_validate_user_signup($user_name, $user_email) {
$errors->add('user_email', __( 'Please enter a valid email address.' ) );
$limited_email_domains = get_site_option( 'limited_email_domains' );
- if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) {
+ if ( is_array( $limited_email_domains ) && ! empty( $limited_email_domains ) ) {
$emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) );
- if ( in_array( $emaildomain, $limited_email_domains ) == false )
+ if ( ! in_array( $emaildomain, $limited_email_domains ) ) {
$errors->add('user_email', __('Sorry, that email address is not allowed!'));
+ }
}
// Check if the username has been used already.
@@ -627,7 +628,7 @@ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) {
if ( preg_match( '/[^a-z0-9]+/', $blogname ) )
$errors->add('blogname', __( 'Only lowercase letters (a-z) and numbers are allowed.' ) );
- if ( in_array( $blogname, $illegal_names ) == true )
+ if ( in_array( $blogname, $illegal_names ) )
$errors->add('blogname', __( 'That name is not allowed.' ) );
if ( strlen( $blogname ) < 4 && !is_super_admin() )
@@ -673,7 +674,7 @@ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) {
$errors->add( 'blogname', __( 'Sorry, that site already exists!' ) );
if ( username_exists( $blogname ) ) {
- if ( is_object( $user ) == false || ( is_object($user) && ( $user->user_login != $blogname ) ) )
+ if ( ! is_object( $user ) || ( is_object($user) && ( $user->user_login != $blogname ) ) )
$errors->add( 'blogname', __( 'Sorry, that site is reserved!' ) );
}
@@ -1689,7 +1690,7 @@ function get_dirsize( $directory ) {
if ( is_array( $dirsize ) && isset( $dirsize[ $directory ][ 'size' ] ) )
return $dirsize[ $directory ][ 'size' ];
- if ( false == is_array( $dirsize ) )
+ if ( ! is_array( $dirsize ) )
$dirsize = array();
$dirsize[ $directory ][ 'size' ] = recurse_dirsize( $directory );
diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php
index 7870e2fd48..fcf198bd9f 100644
--- a/src/wp-includes/pluggable.php
+++ b/src/wp-includes/pluggable.php
@@ -1137,7 +1137,7 @@ function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) {
$result = wp_verify_nonce( $nonce, $action );
- if ( $die && false == $result ) {
+ if ( $die && false === $result ) {
if ( defined( 'DOING_AJAX' ) && DOING_AJAX )
wp_die( -1 );
else
diff --git a/src/wp-includes/revision.php b/src/wp-includes/revision.php
index ace578e0c3..0ed12e1f9c 100644
--- a/src/wp-includes/revision.php
+++ b/src/wp-includes/revision.php
@@ -522,7 +522,7 @@ function _show_post_preview() {
if ( isset($_GET['preview_id']) && isset($_GET['preview_nonce']) ) {
$id = (int) $_GET['preview_id'];
- if ( false == wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) )
+ if ( false === wp_verify_nonce( $_GET['preview_nonce'], 'post_preview_' . $id ) )
wp_die( __('You do not have permission to preview drafts.') );
add_filter('the_preview', '_set_preview');
diff --git a/src/wp-signup.php b/src/wp-signup.php
index a519bcc0d6..7cef5447ff 100644
--- a/src/wp-signup.php
+++ b/src/wp-signup.php
@@ -7,7 +7,7 @@ add_action( 'wp_head', 'wp_no_robots' );
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
-if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) == true ) {
+if ( is_array( get_site_option( 'illegal_names' )) && isset( $_GET[ 'new' ] ) && in_array( $_GET[ 'new' ], get_site_option( 'illegal_names' ) ) ) {
wp_redirect( network_home_url() );
die();
}
@@ -700,9 +700,9 @@ if ( $active_signup == 'none' ) {
do_action( 'preprocess_signup_form' );
if ( is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'blog' ) )
signup_another_blog($newblogname);
- elseif ( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) )
+ elseif ( ! is_user_logged_in() && ( $active_signup == 'all' || $active_signup == 'user' ) )
signup_user( $newblogname, $user_email );
- elseif ( is_user_logged_in() == false && ( $active_signup == 'blog' ) )
+ elseif ( ! is_user_logged_in() && ( $active_signup == 'blog' ) )
_e( 'Sorry, new registrations are not allowed at this time.' );
else
_e( 'You are logged in already. No need to register again!' );
diff --git a/tests/phpunit/tests/customize/setting.php b/tests/phpunit/tests/customize/setting.php
index 5f77c2777d..322f4fe10f 100644
--- a/tests/phpunit/tests/customize/setting.php
+++ b/tests/phpunit/tests/customize/setting.php
@@ -379,7 +379,7 @@ class Tests_WP_Customize_Setting extends WP_UnitTestCase {
$post_value = rand_str();
$this->manager->set_post_value( $name, $post_value );
$setting = new WP_Customize_Setting( $this->manager, $name, compact( 'type' ) );
- $this->assertNull( $setting->is_current_blog_previewed() );
+ $this->assertFalse( $setting->is_current_blog_previewed() );
$setting->preview();
$this->assertTrue( $setting->is_current_blog_previewed() );