xprofile_record_activity( array|string $args = '' )

Records activity for the logged in user within the profile component so that it will show in the users activity stream (if installed).


Parameters Parameters

$args

(array|string) (Optional) String containing all variables used after bp_parse_args() call.

Default value: ''


Top ↑

Return Return

(WP_Error|bool|int)


Source Source

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

function xprofile_record_activity( $args = '' ) {

	// Bail if activity component is not active.
	if ( ! bp_is_active( 'activity' ) ) {
		return false;
	}

	// Parse the arguments.
	$r = bp_parse_args( $args, array(
		'user_id'           => bp_loggedin_user_id(),
		'action'            => '',
		'content'           => '',
		'primary_link'      => '',
		'component'         => buddypress()->profile->id,
		'type'              => false,
		'item_id'           => false,
		'secondary_item_id' => false,
		'recorded_time'     => bp_core_current_time(),
		'hide_sitewide'     => false
	) );

	return bp_activity_add( $r );
}


Top ↑

Changelog Changelog

Changelog
Version Description
1.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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