Site icon Hip-Hop Website Design and Development

Can you have more than one nonce on a page?

I have a site with a page where there’s one form in the sidebar, and one in the main body of the page. The sidebar comes first in the HTML.

Both forms have their own nonces (generated with wp_nonce_field) with different $action and $name parameters. The $referrer fields are on.

When I submit the second form, I get the usual “Are you sure you want to do this?” message.

If I remove the first form, things work correctly.

I added some debugging to wp_verify_nonce (var_dump statements and an exit;) and it’s failing after a NULL $nonce and the $action of the first form (i.e. the one I haven’t submitted.)

$_POST contains all of the second form, as you’d expect.

Any ideas?