Use an id on a button to update_post_meta in post
As @s_ha_dum has stated, your syntax mixes JS and PHP; and Ajax wil be needed. I’ll try to point you in the correct direction. This should be your javascript: jQuery(document).ready(function($) { $(‘button#rsvp_button’).click(function qwe4_tracker(){ var data = { action: ‘my_action’ }; $.post(ajaxurl, data, function(response) { //alert(‘Got this from the server: ‘ + response); // Uncomment to … Read more