BP_Akismet::add_activity_stream_nonce()

Generate nonces for activity forms.

Description

These nonces appear in the member profile status form, as well as in the reply form of each activity item. The nonces are, in turn, used by Akismet to help detect spam activity.

See also

Source

File: bp-activity/classes/class-bp-akismet.php

139
140
141
142
143
144
145
146
147
148
149
150
public function add_activity_stream_nonce() {
    $form_id = '_bp_as_nonce';
    $value   = '_bp_as_nonce_' . bp_loggedin_user_id();
 
    // If we're in the activity feed loop, we can use the current item's ID to make the nonce unique.
    if ( 'bp_activity_entry_comments' == current_filter() ) {
        $form_id .= '_' . bp_get_activity_id();
        $value   .= '_' . bp_get_activity_id();
    }
 
    wp_nonce_field( $value, $form_id, false );
}

Changelog

Changelog
Version Description
BuddyPress 1.6.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.