bp_blogs_is_blog_recordable( int $blog_id, int $user_id )

Check whether a given blog should be recorded in activity feeds.

Description

If $user_id is provided, you can restrict site from being recordable only to particular users.

Parameters

$blog_id

(Required) ID of the blog being checked.

$user_id

(Optional) ID of the user for whom access is being checked.

Return

(bool) True if blog is recordable, otherwise false.

Source

File: bp-blogs/bp-blogs-functions.php

function bp_blogs_is_blog_recordable( $blog_id, $user_id = 0 ) {

	/**
	 * Filters whether or not a blog is globally activity feed recordable.
	 *
	 * @since BuddyPress 1.7.0
	 *
	 * @param bool $value   Whether or not recordable. Default true.
	 * @param int  $blog_id Current blog ID.
	 */
	$recordable_globally = apply_filters( 'bp_blogs_is_blog_recordable', true, $blog_id );

	if ( !empty( $user_id ) ) {
		/**
		 * Filters whether or not a blog is globally activity feed recordable for user.
		 *
		 * @since BuddyPress 1.7.0
		 *
		 * @param bool $recordable_globally Whether or not recordable.
		 * @param int  $blog_id             Current blog ID.
		 * @param int  $user_id             Current user ID.
		 */
		$recordable_for_user = apply_filters( 'bp_blogs_is_blog_recordable_for_user', $recordable_globally, $blog_id, $user_id );
	} else {
		$recordable_for_user = $recordable_globally;
	}

	if ( !empty( $recordable_for_user ) ) {
		return true;
	}

	return $recordable_globally;
}

Changelog

Changelog
Version Description
BuddyPress 1.7.0 Introduced.

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.