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

265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
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.