How do I know if a user has a blog in WordPress Multisite?

I have a WordPress Multisite installation with Buddypress. I would want to restrict people from creating another blog so that they have only one blog.

How do I achieve this?

Related posts

Leave a Reply

1 comment

  1. Check the user meta key primary_blog:

    $user_has_blog = get_user_meta( $user_id, 'primary_blog', TRUE );
    

    For users without a blog $user_has_blog will be false now. For other users $user_has_blog is the blog ID.