Coding Standards: Fix WPCS issues in plugin and theme upgrader classes.

See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47814 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-05-17 09:37:12 +00:00
parent 2a81a84e12
commit 5e43c07be4
3 changed files with 3 additions and 3 deletions

View File

@ -553,7 +553,7 @@ class Plugin_Upgrader extends WP_Upgrader {
// If plugin is in its own directory, recursively delete the directory.
// Base check on if plugin includes directory separator AND that it's not the root plugin folder.
if ( strpos( $plugin, '/' ) && $this_plugin_dir != $plugins_dir ) {
if ( strpos( $plugin, '/' ) && $this_plugin_dir !== $plugins_dir ) {
$deleted = $wp_filesystem->delete( $this_plugin_dir, true );
} else {
$deleted = $wp_filesystem->delete( $plugins_dir . $plugin );

View File

@ -65,7 +65,7 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
admin_url( 'customize.php' )
);
if ( get_stylesheet() == $stylesheet ) {
if ( get_stylesheet() === $stylesheet ) {
if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) {
$update_actions['preview'] = sprintf(
'<a href="%s" class="hide-if-no-customize load-customize">' .

View File

@ -577,7 +577,7 @@ class Theme_Upgrader extends WP_Upgrader {
}
// Ensure stylesheet name hasn't changed after the upgrade:
if ( get_stylesheet() === $theme && $theme != $this->result['destination_name'] ) {
if ( get_stylesheet() === $theme && $theme !== $this->result['destination_name'] ) {
wp_clean_themes_cache();
$stylesheet = $this->result['destination_name'];
switch_theme( $stylesheet );