title: WP function not receiving Ajax variable
body: <p>I'm getting trying to learn some AJAX for WordPress yet getting stumped at what seems like it should be simple. AJAX function gets the ID correctly, sends it via admin-ajax.php (which I can see in XHR tab of devtools) but function won't receive it. What am I missing please?</p>
  
  <pre><code>jQuery(document).ready( function($) {
  
      var post_id = $('article').attr('ID');
      post_id = post_id.replace('post-','');
      console.log(post_id);
  
      $.ajax({
          url: updatecount.ajax_url,
          data : {
              action : 'updateCount',
              post_id : post_id,
          },
  
          success : function( data ) {
             console.log(data)
          },
  
          error : function( data ) {
              console.log('failed');
          }
  
      })
  })
  </code></pre>
  
  <p>...and the function it is calling is as follows:</p>
  
  <pre><code>function updateCount() {
  
      $post_id = intval($_POST['post_id']);
      echo 'Function has ID as: '. $post_id;
      die(); 
  }
  </code></pre>
  
  <p>This returns the following console output:</p>
  
  <pre><code>AJAX has ID as: 187963
  Function has ID as: 0
  </code></pre>