Forums

How to verify the WP nonce after saving a Post (1 post)

  1. Phil Gyford
    Member
    Posted 6 months ago #

    I'm writing a function to do some extra things when I save a post. I'm hooking into the 'post_updated' action and following examples like this, I want to check the nonce is correct.

    if ( !wp_verify_nonce( $_POST['myplugin_noncename'], plugin_basename( __FILE__ ) ) )
          return;

    I'm not sure what to do with that. I'm not writing a plugin - my function is just in my theme's functions.php - and I guess I just want to check whatever the standard nonce is on the WP Post Create/Update page... how do I use wp_verify_nonce() for that? Thanks.

Reply

You must log in to post.

About this Topic