bbp_update_user_last_posted( int $user_id, int $time )

Update a users last posted time, for use with post throttling

Description

Parameters

$user_id

(Required) User ID to update

$time

(Required) Time in time() format

Return

(bool) False if no user or failure, true if successful

Source

File: bp-forums/users/options.php

259
260
261
262
263
264
265
266
267
268
269
270
271
function bbp_update_user_last_posted( $user_id = 0, $time = 0 ) {
 
    // Validate user id
    $user_id = bbp_get_user_id( $user_id );
    if ( empty( $user_id ) )
        return false;
 
    // Set time to now if nothing is passed
    if ( empty( $time ) )
        $time = time();
 
    return update_user_option( $user_id, '_bbp_last_posted', $time );
}

Changelog

Changelog
Version Description
bbPress (r3910) 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.