BP_Blogs_Blog::exists()

Check whether an association between this user and this blog exists.

Description

Return

(int) $value The number of associations between the user and blog saved in the blog component tables.

Source

File: bp-blogs/classes/class-bp-blogs-blog.php

	public function exists() {
		global $wpdb;

		$bp = buddypress();

		return $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(id) FROM {$bp->blogs->table_name} WHERE user_id = %d AND blog_id = %d", $this->user_id, $this->blog_id ) );
	}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.