bb_nonce_url

Retrieve URL with nonce added to URL query.

Description

(string) bb_nonce_url( (string) $actionurl, (int) $action = -1 ); 

Returns (string)

URL with nonce action added.

Parameters (2)

0. $actionurl (string)
URL to add nonce action
1. $action — Optional. (int) => -1
Nonce action name

Usage

  1. if ( !function_exists( 'bb_nonce_url' ) ) { 
  2. require_once '/bp-forums/bbpress/bb-includes/functions.bb-core.php'; 
  3.  
  4. // URL to add nonce action 
  5. $actionurl = ''; 
  6.  
  7. // Optional. Nonce action name 
  8. $action = -1; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = bb_nonce_url($actionurl, $action); 
  12.  

Defined (1)

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

/bp-forums/bbpress/bb-includes/functions.bb-core.php  
  1. function bb_nonce_url( $actionurl, $action = -1 ) { 
  2. $actionurl = str_replace( '&', '&', $actionurl ); 
  3. $nonce = bb_create_nonce( $action ); 
  4. return esc_html( add_query_arg( '_wpnonce', $nonce, $actionurl ) );