Do I need a nonce in the "edit post" page?
-
Hello! This is my first post. I’m writing my first plugin and I have a doubt: I add a few input fields in the post editor page to manage some custom fields, using the ‘add_meta_box’ function:
add_meta_box('vlxs-form', 'Post subtitle', 'vlxs_print_form', 'post', 'normal', 'high');
The ‘vlxs_print_form’ is the function responsible of outputting my <input> fields, and another function called ‘vlxs_store’ uses the values of those input fields.
Everything goes fine until I attempt to add a nonce field to my input fields and the corresponding function to verify the nonce in the ‘vlxs_store’ function (I use ‘wp_nonce_field’ and ‘admin_check_referer’ functions, respectively). When I do this, I’m not able to save or publish a new post, and I suppose it’s because the “edit post” page already contains its own nonce field. Am I wrong?Thank you
- The topic ‘Do I need a nonce in the "edit post" page?’ is closed to new replies.