Skip to content

Commit

Permalink
Coding Standards: Fix WPCS issues in plugin and theme upgrader classes.
Browse files Browse the repository at this point in the history
See #49542.

git-svn-id: https://develop.svn.wordpress.org/trunk@47814 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed May 17, 2020
1 parent 2a81a84 commit 5e43c07
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-plugin-upgrader.php
Expand Up @@ -553,7 +553,7 @@ public function delete_old_plugin( $removed, $local_destination, $remote_destina

// 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 );
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-theme-upgrader-skin.php
Expand Up @@ -65,7 +65,7 @@ public function after() {
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">' .
Expand Down
2 changes: 1 addition & 1 deletion src/wp-admin/includes/class-theme-upgrader.php
Expand Up @@ -577,7 +577,7 @@ public function current_after( $return, $theme ) {
}

// 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 );
Expand Down

0 comments on commit 5e43c07

Please sign in to comment.