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
- Check nonce in the new bulk_edit_posts action
- Nonces can be reused multiple times? Bug / Security issue?
- How do I create a user using the new JSON api in 4.7?
- Is wp_nonce_field vulnerable if you know the action name?
- Using nonce in menu item
- Is it safe to assume that a nonce may be validated more than once?
- Should nonce be sanitized?
- Using Nonces for AJAX that only retrieves data
- WordPress REST API call generates nonce twice on every call
- How to verify nonce from Bulk/Quick Edit in save_post?
- WordPress failure when logging out
- Reduce nonce lifespan
- Ajax function returns -1
- Custom Meta Boxes – Nonce Issue – Move to trash issue
- wp_verify_nonce always returns false when logged in as admin
- how to get nonce using json api
- Confusion on WP Nonce usage in my Plugin
- Properly applying nonce to a form using AJAX
- WordPress password reset – why post rp_key?
- AJAX requests broken due to HTTPS for wp-admin
- Full page NGINX (or Cloudflare) caching and WordPress nonces
- Why save_post_$(custom_post_type) is fired even if I am not already saving a post?
- wp_nonce_url to users.php for deleting user not working
- How can I create a plugin installation link?
- Security checking in meta_box save is reluctant?
- How to check an ajax nonce in PHP
- wp_verify_nonce not working
- Can a wp_nonce created from domain 1 to be verified on domain 2?
- Help with forms and nonces
- how to send Ajax request in wordpress backend
- WP Admin AJAX Security – using POST to include a relative URL
- Confusion regarding Nonce & using it in Custom Columns for Saving Checkbox Value to Post Meta
- wp_create_nonce() in REST API makes user->ID zero
- ajax nonce verification failing
- wp_create_nonce function doesn’t work inside a plugin?
- Custom post type: check permissions and validate nonce
- Nonce failing on form submission
- Found 2 elements with non-unique id (#_ajax_nonce) and (#_wpnonce)
- Why ajax doesn’t work on certain wordpress hooks?
- Are nonces in WP REST API optional by default?
- Custom login doesn’t work properly
- Is there value in using a wp_nonce for POST requests?
- Can you have more than one nonce on a page?
- My custom write panels won’t save data. What am I missing?
- Unable to successfully verify nonce
- wp_nonce_field is breaking form for reasons unknown
- Cache plugins and ajax nonce verification
- Forms and WordPress Nonce
- javascript ajax and nonce
- How to use the wpsnonce clone post link?
- Nonce failing with second argument
- How to verify which WordPress user requested the API in ASP .NET Core?
- Log out without confirmation request (nonce)
- Ajax Security regarding user priviliges and nonces
- 403 Forbidden on site logo image upload
- Nonce and widget
- custom metabox nonce verification fails
- How to use nonces for frontend AJAX voting if the page gets cached?
- Using Nonce for my Form
- Saving metabox updates causing fatal error
- wp_verify_nonce is always false even when the nonces are identical
- Is there a solution to expired nonces in forms when using full page caching that doesn’t involve configuring the cache?