_bp_update_user_meta_last_activity_warning( int $meta_id, int $object_id, string $meta_key, string $meta_value )
Backward compatibility for ‘last_activity’ usermeta setting.
Description
In BuddyPress 2.0, user last_activity data was moved out of usermeta. For backward compatibility, we continue to mirror the data there. This function serves two purposes: it warns plugin authors of the change, and it updates the data in the proper location.
Parameters
- $meta_id
-
(Required) ID of the just-set usermeta row.
- $object_id
-
(Required) ID of the user.
- $meta_key
-
(Required) Meta key being fetched.
- $meta_value
-
(Required) Active time.
Source
File: bp-members/bp-members-functions.php
function _bp_update_user_meta_last_activity_warning( $meta_id, $object_id, $meta_key, $meta_value ) { if ( 'last_activity' === $meta_key ) { _doing_it_wrong( 'update_user_meta( $user_id, \'last_activity\' )', __( 'User last_activity data is no longer stored in usermeta. Use bp_update_user_last_activity() instead.', 'buddyboss' ), '2.0.0' ); bp_update_user_last_activity( $object_id, $meta_value ); } }
Changelog
Version | Description |
---|---|
BuddyPress 2.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.