Skip to content

Instantly share code, notes, and snippets.

@gmax21
Created September 5, 2014 23:26
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 gmax21/771dfdacb2a083cc96e3 to your computer and use it in GitHub Desktop.
Save gmax21/771dfdacb2a083cc96e3 to your computer and use it in GitHub Desktop.
Get site mapped domain echoed - WPMU DEV Domain Mapping
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