_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 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.

Top ↑

Parameters Parameters


(int) (Required) ID of the just-set usermeta row.


(int) (Required) ID of the user.


(string) (Required) Meta key being fetched.


(string) (Required) Active time.

Source 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.', 'buddypress' ), '2.0.0' );
		bp_update_user_last_activity( $object_id, $meta_value );

Top ↑

Changelog Changelog

Version Description
2.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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