BP_Akismet::add_activity_stream_nonce()

Generate nonces for activity forms.


Description 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 See also


Top ↑

Source Source

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

	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 stream 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 );
	}


Top ↑

Changelog Changelog

Changelog
Version Description
1.6.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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