Created
December 2, 2015 21:57
-
-
Save vaughanm/7fccc055466d2cf8b217 to your computer and use it in GitHub Desktop.
Get Blog creators ID
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 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