wp_nonce_url( string $actionurl, int|string $action = -1, string $name = '_wpnonce' )
Retrieves URL with nonce added to URL query.
Parameters
- $actionurl
-
(Required) URL to add nonce action.
- $action
-
(Optional) Nonce action name.
Default value: -1
- $name
-
(Optional) Nonce name. Default '_wpnonce'.
Default value: '_wpnonce'
Return
(string) Escaped URL with nonce action added.
Source
File: wp-includes/functions.php
function wp_nonce_url( $actionurl, $action = -1, $name = '_wpnonce' ) {
$actionurl = str_replace( '&', '&', $actionurl );
return esc_html( add_query_arg( $name, wp_create_nonce( $action ), $actionurl ) );
}
Changelog
Version | Description |
---|---|
2.0.4 | Introduced. |