BP_Group_Extension::nonce_field( string $context = '' )
Generate the nonce fields for a settings form.
Description
The nonce field name (the second param passed to wp_nonce_field) contains this extension’s slug and is thus unique to this extension. This is necessary because in some cases (namely, the Dashboard), more than one extension may generate nonces on the same page, and we must avoid name clashes.
Parameters
- $context
-
(Optional) Screen context. 'create', 'edit', or 'admin'.
Default value: ''
Source
File: bp-groups/classes/class-bp-group-extension.php
public function nonce_field( $context = '' ) { wp_nonce_field( 'bp_group_extension_' . $this->slug . '_' . $context, '_bp_group_' . $context . '_nonce_' . $this->slug ); }
Changelog
Version | Description |
---|---|
BuddyPress 1.8.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.