Skip to content

Instantly share code, notes, and snippets.

@ptasker
Last active December 8, 2016 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptasker/3beaa16a5d0333cf49b0e202eaf40849 to your computer and use it in GitHub Desktop.
Save ptasker/3beaa16a5d0333cf49b0e202eaf40849 to your computer and use it in GitHub Desktop.
wpmdb-list-all-subsites.php
<?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