fix(2meet-data-optimizer-latepoint-addon): remove data on every site of a large network on uninstall
- get_sites() returns 100 sites by default; with 'number' => 0 the index table and option are dropped on every site of the network - Verify: php -l; phpcs unchanged (1 existing error on the DROP TABLE line) - PR: PR-100
This commit is contained in:
+9
-1
@@ -15,7 +15,15 @@ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
|||||||
// dropping it loses no data; LatePoint's tables are left untouched.
|
// dropping it loses no data; LatePoint's tables are left untouched.
|
||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
$tmdo_latepoint_blogs = is_multisite() ? get_sites( array( 'fields' => 'ids' ) ) : array( get_current_blog_id() );
|
// 'number' => 0: get_sites() returns only 100 sites by default.
|
||||||
|
$tmdo_latepoint_blogs = is_multisite()
|
||||||
|
? get_sites(
|
||||||
|
array(
|
||||||
|
'fields' => 'ids',
|
||||||
|
'number' => 0,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
: array( get_current_blog_id() );
|
||||||
foreach ( $tmdo_latepoint_blogs as $tmdo_latepoint_blog ) {
|
foreach ( $tmdo_latepoint_blogs as $tmdo_latepoint_blog ) {
|
||||||
if ( is_multisite() ) {
|
if ( is_multisite() ) {
|
||||||
switch_to_blog( $tmdo_latepoint_blog );
|
switch_to_blog( $tmdo_latepoint_blog );
|
||||||
|
|||||||
Reference in New Issue
Block a user