Opened 6 months ago

Closed 3 months ago

#22423 closed enhancement (fixed)

Argument parameter for wp_nonce_url

Reported by: MatthewRuddy Owned by: nacin
Priority: normal Milestone: 3.6
Component: Security Version: 3.4.2
Severity: trivial Keywords: has-patch commit
Cc: juliobosk@…

Description

The wp_nonce_url function in includes/functions.php doesn't allow the user to set the nonce argument name, unlike wp_nonce_field. Slight inconvenience when trying to attach different nonces to different URLs. Don't see the harm in adding an optional parameter for the argument name to the wp_nonce_url function. Modified functions.php file attached.

Attachments (3)

functions.php (115.4 KB) - added by MatthewRuddy 6 months ago.
Said modification to wp-includes/functions.php file
functions.diff (666 bytes) - added by MatthewRuddy 6 months ago.
22423.diff (950 bytes) - added by SergeyBiryukov 4 months ago.

Download all attachments as: .zip

Change History (12)

Said modification to wp-includes/functions.php file

  • Keywords needs-patch added; has-patch removed

Could you provide an actual patch, rather than the entire file?

Take a look at http://make.wordpress.org/core/handbook/submitting-a-patch/.

My apologies!

  • Cc juliobosk@… added

Hello, i was wondering why we can not change this, and this trac exists.
So, can we add this in 3.6 now ? The patch seems correct for me.
Thank you

  • Keywords has-patch commit added; 2nd-opinion needs-patch removed

+1. Seems like this never got marked with the correct keywords, so it probably got missed.

New patch looks good.

Sorry guys, new to this! Feel free to change any mistakes I've made.

$arg should probably be $name, for consistency with wp_nonce_field().

  • Type changed from defect (bug) to enhancement
  • Milestone changed from Awaiting Review to 3.6
  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 23519:

Allow nonce name to be passed to wp_nonce_url(), as allowed by wp_nonce_field(). props MatthewRuddy, fixes #22423.

Note: See TracTickets for help on using tickets.