Nonce redirects to "Are you sure you want to do this" after action goes through
-
Hello and thanks ahead of time to anyone who takes the time to read this. I’m working on the options page for my first plugin ever and am running into a problem.
The full code for my options page is here.
Basically, the options page will accept custom field meta keys that will be used in the plugin to search for and extract broken links. I’ve set it up so that by clicking “Add another field”, an integer in the options table is increased by one (i’ll refer to this as count), and 3 of the ‘add_settings_field’ functions depend on this count as they are looped through x times (lines 90-116 ). This all works fine.
Now, I’m trying to set up a ‘remove’ link next to each added custom field (on line 168 of my code). The link will eventually 1. decrease the count integer by one and 2. remove the data for the particular instance being removed. I’ve only added the first part so far.
On the page, when I click the remove button, I get “Are you sure you want to do this? Please try again.” The strange thing is that the action is carried out anyway, and the count is my database is decreased by one. If the action is carried out, doesn’t that mean the nonce is valid? And if it is valid, why would I keep getting the “Are you sure” message?
Sorry if this is long-winded…just trying to be as detailed as possible.
I would truly appreciate any ideas of where to begin troubleshooting!
- The topic ‘Nonce redirects to "Are you sure you want to do this" after action goes through’ is closed to new replies.