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 feed (if installed).
Description
Parameters
- $args
-
(Optional) String containing all variables used after bp_parse_args() call.
Default value: ''
Return
(WP_Error|bool|int)
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 ); }
Changelog
Version | Description |
---|---|
BuddyPress 1.0.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.