Allow nonce name to be passed to wp_nonce_url(), as allowed by wp_nonce_field(). props MatthewRuddy, fixes #22423.
git-svn-id: http://core.svn.wordpress.org/trunk@23519 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
2301074821
commit
81080da6f2
|
@ -1168,13 +1168,14 @@ function is_blog_installed() {
|
|||
* @subpackage Security
|
||||
* @since 2.0.4
|
||||
*
|
||||
* @param string $actionurl URL to add nonce action
|
||||
* @param string $action Optional. Nonce action name
|
||||
* @param string $actionurl URL to add nonce action.
|
||||
* @param string $action Optional. Nonce action name.
|
||||
* @param string $name Optional. Nonce name.
|
||||
* @return string URL with nonce action added.
|
||||
*/
|
||||
function wp_nonce_url( $actionurl, $action = -1 ) {
|
||||
function wp_nonce_url( $actionurl, $action = -1, $name = '_wpnonce' ) {
|
||||
$actionurl = str_replace( '&', '&', $actionurl );
|
||||
return esc_url( add_query_arg( '_wpnonce', wp_create_nonce( $action ), $actionurl ) );
|
||||
return esc_url( add_query_arg( $name, wp_create_nonce( $action ), $actionurl ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue