-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply fixes for new coding standards
- Loading branch information
Showing
5 changed files
with
20 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,31 @@ | ||
<?php | ||
/** | ||
* Fired when the plugin is uninstalled. | ||
* | ||
* @package WP_Widget_Disable | ||
* @author Silvan Hagen <[email protected]> | ||
* @license GPL-2.0+ | ||
* @link http://wp.required.ch/plugins/wp-widget-disable | ||
* @copyright 2015 required gmbh | ||
* Included when the plugin is uninstalled. | ||
*/ | ||
|
||
defined( 'WP_UNINSTALL_PLUGIN' ) || die; | ||
|
||
$options = [ | ||
$widget_disable_options = [ | ||
'rplus_wp_widget_disable_sidebar_option', | ||
'rplus_wp_widget_disable_dashboard_option', | ||
]; | ||
|
||
if ( ! is_multisite() ) { | ||
foreach ( $options as $option ) { | ||
delete_option( $option ); | ||
foreach ( $widget_disable_options as $widget_disable_option ) { | ||
delete_option( $widget_disable_option ); | ||
} | ||
} else { | ||
global $wpdb; | ||
|
||
$blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" ); | ||
$original_blog_id = get_current_blog_id(); | ||
$widget_disable_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" ); | ||
|
||
foreach ( $blog_ids as $blog_id ) { | ||
switch_to_blog( $blog_id ); | ||
foreach ( $widget_disable_ids as $widget_disable_id ) { | ||
switch_to_blog( $widget_disable_id ); | ||
|
||
foreach ( $options as $option ) { | ||
delete_option( $option ); | ||
foreach ( $widget_disable_options as $widget_disable_option ) { | ||
delete_option( $widget_disable_option ); | ||
} | ||
} | ||
|
||
switch_to_blog( $original_blog_id ); | ||
restore_current_blog( $widget_disable_id ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,10 @@ | |
* Represents the view for the administration dashboard. | ||
* | ||
* This includes the header, options, and other information that should provide | ||
* The User Interface to the end user. | ||
* | ||
* @package WP_Widget_Disable | ||
* @author Silvan Hagen <[email protected]> | ||
* @license GPL-2.0+ | ||
* @link http://wp.required.ch/plugins/wp-widget-disable | ||
* @copyright 2015 required gmbh | ||
* the User Interface to the end user. | ||
*/ | ||
|
||
// phpcs:disable WordPress.NamingConventions, VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable -- Variables are not global. | ||
$sidebar_tab_url = add_query_arg( | ||
[ | ||
'page' => 'wp-widget-disable', | ||
|
@@ -28,7 +23,7 @@ | |
|
||
$active_tab = $this->sidebar_widgets_option; | ||
|
||
// phpcs:ignore WordPress.CSRF.NonceVerification.NoNonceVerification | ||
// phpcs:ignore WordPress.Security.NonceVerification | ||
if ( is_network_admin() || ( isset( $_GET['tab'] ) && 'dashboard' === $_GET['tab'] ) ) { | ||
$active_tab = $this->dashboard_widgets_option; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters