title: Running a function in Wordpress when publishing a custom post type
body: <p>I am trying to run the following function anytime a wordpress "Jobs" custom post is published. The code works (lines 2-7) when it is placed in my theme template, but it only runs when the post is viewed. I want the code to run when the post is published, and so I have tried adding the code in a function inside my functions.php, but nothing is happening when each custom post is published. Any suggestions?</p>
  
  <pre><code>function indeedgeo(){
      $indeedgeo = get_post_meta($post&gt;ID, indeedgeo, true);
      $indeedgeos=explode(' ',$indeedgeo);
      $_jr_geo_latitude = $indeedgeos[0];
      $_jr_geo_longitude = $indeedgeos[1];
      update_post_meta($post-&gt;ID, _jr_geo_latitude, $_jr_geo_latitude);
      update_post_meta($post-&gt;ID, _jr_geo_longitude, $_jr_geo_longitude);
      }
  add_action('publish_Jobs', 'indeedgeo');
  </code></pre>