Created
September 5, 2014 23:26
-
-
Save gmax21/771dfdacb2a083cc96e3 to your computer and use it in GitHub Desktop.
Get site mapped domain echoed - WPMU DEV Domain Mapping
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
function tkb_get_mapped_domain($site_id = NULL){ | |
global $wpdb; | |
if ($site_id === NULL){ | |
$site_id = get_current_blog_id(); | |
} | |
$mapped_domain = $wpdb->get_var( $wpdb->prepare( "SELECT domain FROM {$wpdb->dmtable} WHERE blog_id = %d LIMIT 1", $site_id ) ); | |
echo $mapped_domain; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment