ajax nonce verification failing
To verify nonces in Ajax requests, check_ajax_referrer() should be used instead of wp_verify_nonce(): Crete the nonce: $nonce = wp_create_nonce( ‘vote-nonce-‘ . get_the_ID() ); Include it in JavaScript: jQuery(document).ready(function(){ jQuery(“.post-voting”).click(function(){ vote_nonce = <?php echo $nonce; ?> vote_id = jQuery(this).data(‘vote-id’); jQuery.post( vote_ajax.url, { action: ‘submit_vote’, vote_id: vote_id, vote_nonce: vote_nonce }, function( data ) { alert( jQuery.parseJSON(data) ); … Read more