mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 04:40:26 +00:00
Coding Standards: Use strict comparison where static strings are involved.
This reduces the number of `WordPress.PHP.StrictComparisons.LooseComparison` issues in half, from 1897 to 890. Includes minor code layout fixes for better readability. See #49542. git-svn-id: https://develop.svn.wordpress.org/trunk@47808 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -22,7 +22,7 @@ if ( isset( $_GET['action'] ) ) {
|
||||
$theme = isset( $_REQUEST['theme'] ) ? urldecode( $_REQUEST['theme'] ) : '';
|
||||
$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
|
||||
|
||||
if ( 'update-selected' == $action ) {
|
||||
if ( 'update-selected' === $action ) {
|
||||
if ( ! current_user_can( 'update_plugins' ) ) {
|
||||
wp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) );
|
||||
}
|
||||
@@ -50,7 +50,7 @@ if ( isset( $_GET['action'] ) ) {
|
||||
|
||||
iframe_footer();
|
||||
|
||||
} elseif ( 'upgrade-plugin' == $action ) {
|
||||
} elseif ( 'upgrade-plugin' === $action ) {
|
||||
if ( ! current_user_can( 'update_plugins' ) ) {
|
||||
wp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) );
|
||||
}
|
||||
@@ -72,7 +72,7 @@ if ( isset( $_GET['action'] ) ) {
|
||||
|
||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||
|
||||
} elseif ( 'activate-plugin' == $action ) {
|
||||
} elseif ( 'activate-plugin' === $action ) {
|
||||
if ( ! current_user_can( 'update_plugins' ) ) {
|
||||
wp_die( __( 'Sorry, you are not allowed to update plugins for this site.' ) );
|
||||
}
|
||||
@@ -98,7 +98,7 @@ if ( isset( $_GET['action'] ) ) {
|
||||
include WP_PLUGIN_DIR . '/' . $plugin;
|
||||
}
|
||||
iframe_footer();
|
||||
} elseif ( 'install-plugin' == $action ) {
|
||||
} elseif ( 'install-plugin' === $action ) {
|
||||
|
||||
if ( ! current_user_can( 'install_plugins' ) ) {
|
||||
wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );
|
||||
@@ -141,7 +141,7 @@ if ( isset( $_GET['action'] ) ) {
|
||||
|
||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||
|
||||
} elseif ( 'upload-plugin' == $action ) {
|
||||
} elseif ( 'upload-plugin' === $action ) {
|
||||
|
||||
if ( ! current_user_can( 'upload_plugins' ) ) {
|
||||
wp_die( __( 'Sorry, you are not allowed to install plugins on this site.' ) );
|
||||
@@ -171,7 +171,7 @@ if ( isset( $_GET['action'] ) ) {
|
||||
|
||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||
|
||||
} elseif ( 'upgrade-theme' == $action ) {
|
||||
} elseif ( 'upgrade-theme' === $action ) {
|
||||
|
||||
if ( ! current_user_can( 'update_themes' ) ) {
|
||||
wp_die( __( 'Sorry, you are not allowed to update themes for this site.' ) );
|
||||
@@ -193,7 +193,7 @@ if ( isset( $_GET['action'] ) ) {
|
||||
$upgrader->upgrade( $theme );
|
||||
|
||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||
} elseif ( 'update-selected-themes' == $action ) {
|
||||
} elseif ( 'update-selected-themes' === $action ) {
|
||||
if ( ! current_user_can( 'update_themes' ) ) {
|
||||
wp_die( __( 'Sorry, you are not allowed to update themes for this site.' ) );
|
||||
}
|
||||
@@ -220,7 +220,7 @@ if ( isset( $_GET['action'] ) ) {
|
||||
$upgrader->bulk_upgrade( $themes );
|
||||
|
||||
iframe_footer();
|
||||
} elseif ( 'install-theme' == $action ) {
|
||||
} elseif ( 'install-theme' === $action ) {
|
||||
|
||||
if ( ! current_user_can( 'install_themes' ) ) {
|
||||
wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
|
||||
@@ -260,7 +260,7 @@ if ( isset( $_GET['action'] ) ) {
|
||||
|
||||
require_once ABSPATH . 'wp-admin/admin-footer.php';
|
||||
|
||||
} elseif ( 'upload-theme' == $action ) {
|
||||
} elseif ( 'upload-theme' === $action ) {
|
||||
|
||||
if ( ! current_user_can( 'upload_themes' ) ) {
|
||||
wp_die( __( 'Sorry, you are not allowed to install themes on this site.' ) );
|
||||
|
||||
Reference in New Issue
Block a user