Although this is working on a couple of live sites, when trying it on localhost using MAMP or Bitnami WP, it throws an error
Call to undefined function wp_verify_nonce();
A suggested workaround involves making sure the required functions are loaded using require_once( ABSPATH .'wp-includes/pluggable.php' );or by hooking into admin_init, which doesn't make sense to me since this runs on the front-end.
Although this is working on a couple of live sites, when trying it on localhost using MAMP or Bitnami WP, it throws an error
Call to undefined function wp_verify_nonce();
A suggested workaround involves making sure the required functions are loaded using
require_once( ABSPATH .'wp-includes/pluggable.php' );or by hooking into admin_init, which doesn't make sense to me since this runs on the front-end.