In line 3 of your form markup, you’re passing two arguments to wp_create_nonce
when it only accepts one. It’s a simple typo. You’ll want to concatenate the string like so:
wp_create_nonce( 'edit_post-'. $post->ID ) //dot instead of comma
EDIT: I’d suggest you give the nonce field a more specific name than _wpnonce
, as this is the generic(default) WordPress name for nonce fields, which means you probably have a conflict with other core nonces or a plugin nonce. Maybe try something like this:
// change the NONCE name to something unique
$data .= '<input type="hidden" id="wpse263026_nonce" name="wpse263026_nonce" value="'. wp_create_nonce( 'edit_post-'. $post->ID ) .'" />';
Related Posts:
- How does nonce verification work?
- How to expire a nonce?
- Fatal error: Call to undefined function wp_create_nonce()
- How to add/retrieve the post trash link?
- Using nonce external of WP Admin
- Nonce best practices: hidden input vs. wp_localize_script?
- “The link you followed has expired” when previewing a post
- wp_verify_nonce keeps failing
- Handling nonce generation in AJAX registration process
- increase nonce lifespan
- Nonce failing in IE
- my theme breaks WP export
- Why am I getting a 403 from check_admin_referer()?
- x-wp-nonce across domains
- wp_create_nonce doesn’t verify when using WP_List_Table
- Handling expired nonces
- What is really “wp_nonce_field” and how does it work? [duplicate]
- Cannot verify nonce
- wp_verify_nonce return false despite correct parameter passed
- WordPress JSON API nonces and Vue development server
- Verify a nonce in Form submission
- phpcs error in WordPress
- Stop WordPress nonces expiring
- Several nonces?
- Nonce for Trashing Item
- Nonce keeps failing
- Public posts – preventing duplicate form submissions
- How to obtain “wp_rest” nonce for WP Statistics plugin manually?
- WordPress “nonce” message
- CSP nonces with Cloudflare Workers
- Why are nonces working in Firefox but not in Chrome?
- wp_verfy_nonce keeps giving false
- Nonce – reissue with ajax poll
- wp_nonce_url generating invalid links
- How to insert wp_nonce field within echoed string
- Nonce check causing issues when creating new post
- Weird nonce validation problem
- Logout button in menu without “wp” in links
- Do I need a nonce field for every meta box I add to my custom post type admin?
- Can I use the same nonce for multiple requests on the same page?
- How to get a unique nonce for each Ajax request?
- Nonce retrieved from the REST API is invalid and different from nonce generated in wp_localize_script
- How to use nonce with front end submission form?
- Extend WordPress (4.x) session and nonce
- Nonces and Cache
- AJAX nonce with check_ajax_referer()
- Verify nonce in REST API?
- What is nonce and how to use it with Ajax in WordPress? [duplicate]
- Do I require the use of nonce?
- Getting “The link you followed has expired” when adding custom post [closed]
- Handling nonces for actions from guests to logged-in users
- How to add WordPress nonces to ajax request
- Can I verify nonce which was generated on a different WP site?
- Security – Ajax and Nonce use [closed]
- Headless WordPress: How to authenticate front end requests?
- Nonces and Ajax request to REST API and verification
- How to stop _wpnonce and _wp_http_referer from appearing in URL
- Undefined index: at_nonce in custom post metabox
- WP REST API: check if user is logged in
- wp_verify_nonce doesn’t return true on server when it matches the nonce
- How to save multiple metaboxes?
- Can’t GET draft posts via REST API from headless frontend
- Rest API invalid nonce with Backbone Client
- Nonce actions and names available via open source
- How to get the wpnonce value?
- WordPress REST API, Expired Nonce from Cache results in 403 forbidden
- How do I check if AJAX nonces are implemented correctly?
- Nonce generated 0-12 hours ago
- Passing a borrowed nonce through Postman fails
- WP nonce invalid
- Maximum lifetime for nonce
- Use of check_admin_referer with theme options and options.php
- Passing nonce at admin menu link
- Encountering “Wrong nonce. Action prohibitied.” when trying to alter User Role and unable to Post via WP Admin
- Bypass nonce value while trashing a post
- My custom write panels won’t save data. What am I missing?
- wp_nonce_field displaying twice
- How to verify nonces in bulk?
- Why do Metabox use Nonces?
- The Correct Way to Use Nonce Field without Settings API
- How to check nonce lifetime value of plugins?
- Does this code indicate an exploit?
- Using nonce when loading posts with AJAX
- Log in user using WordPress REST API
- Should wordpress nonce be placed in html form or in javascript file
- Extend Nonce Lifetime for Specific Nonce Creation
- Change button link to add nonce
- How do I mitigate replay attacks when talking about actions that shouldn’t happen twice?
- How can I verify WordPress nonce from the following code?
- AJAX form not working, still reloads on submit
- check_admin_referer not working in custom meta box for custom post type
- wp_nonce for Front-End submission form not working
- wp_verify_nonce fails always
- Nonce fail after second submit attempt
- custom metabox nonce verification fails
- How to use nonces for frontend AJAX voting if the page gets cached?
- when saveing $meta_box i get Undefined index error
- Using Nonce for my Form
- Metabox nonce not allowing update
- Saving metabox updates causing fatal error