bp_blogs_record_activity_on_site_creation( BP_Blogs_Blog $recorded_blog, bool $is_private, bool $is_recorded,  $no_activity )

Add an activity entry for a newly-created site.


Description Description

Hooked to the ‘bp_blogs_new_blog’ action.


Top ↑

Parameters Parameters

$recorded_blog

(BP_Blogs_Blog) (Required) Current site being recorded. Passed by reference.

$is_private

(bool) (Required) Whether the current site being recorded is private.

$is_recorded

(bool) (Required) Whether the current site was recorded.


Source Source

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

function bp_blogs_record_activity_on_site_creation( $recorded_blog, $is_private, $is_recorded, $no_activity ) {
	// Only record this activity if the blog is public.
	if ( ! $is_private && ! $no_activity && bp_blogs_is_blog_trackable( $recorded_blog->blog_id, $recorded_blog->user_id ) ) {
		bp_blogs_record_activity( array(
			'user_id'      => $recorded_blog->user_id,

			/**
			 * Filters the activity created blog primary link.
			 *
			 * @since 1.1.0
			 *
			 * @param string $value Blog primary link.
			 * @param int    $value Blog ID.
			 */
			'primary_link' => apply_filters( 'bp_blogs_activity_created_blog_primary_link', bp_blogs_get_blogmeta( $recorded_blog->blog_id, 'url' ), $recorded_blog->blog_id ),
			'type'         => 'new_blog',
			'item_id'      => $recorded_blog->blog_id
		) );
	}
}


Top ↑

Changelog Changelog

Changelog
Version Description
2.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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