Created
January 18, 2013 04:00
-
-
Save drrobotnik/4562249 to your computer and use it in GitHub Desktop.
Modified snippet from Kovshenin. echoing out a multisites list of subdomains for easy copy pasting into your local hosts file.
This file contains hidden or 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
/* Repurposed from: http://kovshenin.com/2012/wordpress-multisite-with-wildcard-subdomains/ | |
** I found that giving each subdomain their own entry ran significantly faster. | |
*/ | |
add_action( 'wp_footer', 'print_entry_for_hosts_file' ); | |
function print_entry_for_hosts_file() { | |
global $wpdb; | |
$domains = $wpdb->get_col( "SELECT domain FROM $wpdb->blogs;" ); | |
foreach($domains as $domain){ | |
echo "127.0.0.1 " . $domain . "\n"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment