Skip to content

Instantly share code, notes, and snippets.

@vaughanm
Created December 2, 2015 21:57
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 vaughanm/7fccc055466d2cf8b217 to your computer and use it in GitHub Desktop.
Save vaughanm/7fccc055466d2cf8b217 to your computer and use it in GitHub Desktop.
Get Blog creators ID
function get_blog_creator_id($blog_id) {
global $wpdb;
$blog_id = (int) $blog_id;
if($blog_id !== 0) {
$email = $wpdb->query("SELECT email FROM {$wpdb->prefix}registration_log WHERE blog_id = {$blog_id}");
$user = get_user_by( 'email', $email );
return $user->ID;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment