Last active
December 8, 2016 16:23
-
-
Save ptasker/3beaa16a5d0333cf49b0e202eaf40849 to your computer and use it in GitHub Desktop.
wpmdb-list-all-subsites.php
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
<?php | |
/* | |
Plugin Name: WPMDB - List all subsites | |
Plugin URI: https://gist.github.com/ptasker/3beaa16a5d0333cf49b0e202eaf40849 | |
Description: Fixes get_sites() calls used in WP Migrate DB Pro to return a list of all sites | |
Author: Delicious Brains | |
Author URI: http://deliciousbrains.com | |
Version: 0.1 | |
Network: True | |
*/ | |
function wpmdb_override_wp_site_query_args( $q ) { | |
if ( ( isset( $_GET['page'] ) && 'wp-migrate-db-pro' == $_GET['page'] ) || ( isset( $_POST['action'] ) && false !== strpos( $_POST['action'], 'wpmdb' ) ) ) { | |
$q->query_vars['number'] = false; | |
} | |
} | |
add_action( 'parse_site_query', 'wpmdb_override_wp_site_query_args' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment