In a multisite, how can I get the ID of the owner of the current blog?
I know how to get the current blogs Id using get_current_blog_id(), so given that ID, how would I fetch the ID of the owner of that blog? (there's just one owner per blog.)
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
I came up with this solution for a direct query, but I'd still like to know if there's a template tag I've missed.
$blog_id = get_current_blog_id(); $querystring = "SELECT `user_id` FROM `wp_usermeta` WHERE (meta_key LIKE 'primary_blog' AND meta_value LIKE $blog_id) LIMIT 1"; $blogownerid = $wpdb->get_var($querystring);