Created
July 1, 2014 20:35
-
-
Save tott/0cc78e7dcad18024d1c8 to your computer and use it in GitHub Desktop.
Create a full list of sites with domain mapping with wp-cli
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
for i in `wp site list | cut -f 2 | grep -v url`; do wp --url=$i eval 'global $wpdb, $blog_id; $blogname=get_option("blogname"); $blogurl=home_url(); $domains=$wpdb->get_results( "SELECT * FROM {$wpdb->dmtable} WHERE blog_id = $blog_id;" ); foreach( $domains as $data ) { echo $blog_id.",".$blogname.",".$blogurl.",".$data->domain.",".$data->active."\n"; }'; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment