bb_check_admin_referer

The BuddyPress bb check admin referer function.

Description

bb_check_admin_referer( (int) $action = -1, (string) $query_arg = '_wpnonce' ); 

Parameters (2)

0. $action — Optional. (int) => -1
The action.
1. $query_arg — Optional. (string) => '_wpnonce'
The query arg.

Usage

  1. if ( !function_exists( 'bb_check_admin_referer' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-forums/bbpress/bb-includes/functions.bb-pluggable.php'; 
  3.  
  4. // The action. 
  5. $action = -1; 
  6.  
  7. // The query arg. 
  8. $query_arg = '_wpnonce'; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_check_admin_referer($action, $query_arg); 
  12.  

Defined (1)

The function is defined in the following location(s).

/bp-forums/bbpress/bb-includes/functions.bb-pluggable.php  
  1. function bb_check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) { 
  2. $nonce = ''; 
  3. if ( isset( $_POST[$query_arg] ) && $_POST[$query_arg] ) { 
  4. $nonce = $_POST[$query_arg]; 
  5. } elseif ( isset( $_GET[$query_arg] ) && $_GET[$query_arg] ) { 
  6. $nonce = $_GET[$query_arg]; 
  7. if ( !bb_verify_nonce($nonce, $action) ) { 
  8. bb_nonce_ays($action); 
  9. die();