bp_blogs_is_blog_recordable( int $blog_id, int $user_id )

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


Description Description

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


Top ↑

Parameters Parameters

$blog_id

(int) (Required) ID of the blog being checked.

$user_id

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


Top ↑

Return Return

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


Source 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 stream recordable.
	 *
	 * @since 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 stream recordable for user.
		 *
		 * @since 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;
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.7.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.