title: wp_is_post_autosave is not working
body: <p>I want to auto publish all articles of my WP blog on Facebook without using any plugin.</p>
  
  <p>I wrote some working code to do that and it's OK... but I also need to invoke this code only when I publish a new article (not for revisions or autosave).</p>
  
  <p>That's the part of my function.php file that you need to see:</p>
  
  <pre><code>add_action( 'save_post', 'koolmind_facebook_post_article',3 );
  function koolmind_facebook_post_article( $post_id ) {
      /* configuration of facebook params */
      ....
      ....
      /* end config */
  
      if ( !wp_is_post_revision( $post_id ) &amp;&amp; !wp_is_post_autosave( $post_id ) ) {
  
          /* retrieve some data to publish */
  
          /* invoke my code to publish on facebook */
      }
  }
  </code></pre>
  
  <p>My code is invoked as soon as I click on "add new article", and an empty draft is sent to my Facebook page. 
  In add, as soon as I insert a single char on my article body, autosave is triggered and a new post (almost empty) is sent again to facebook.</p>
  
  <p>I just want to block this automatic publishing and send my data to facebook only when I press the PUBLISH button.</p>
  
  <p>Is that possible?</p>
  
  <hr>
  
  <p>UPDATE</p>
  
  <p>Finally I've found the problem. There was an error inside my fb code.
  Problem now is avoiding multiple pubblication when updating my post.</p>
  
  <p>Here's the code now:</p>
  
  <pre><code>add_action('pending_to_publish', 'koolmind_facebook_post_article');
  add_action('draft_to_publish', 'koolmind_facebook_post_article');
  add_action('new_to_publish', 'koolmind_facebook_post_article');
  
  function koolmind_facebook_post_article( $post_id ) {
  require_once 'facebook/facebook.php';
  
  /* some code here */
  
  //verify post is not a revision
  if ( !wp_is_post_revision( $post_id ) ) {
          $post_title = get_the_title( $post_id );
      $post_url = get_permalink( $post_id );
      $post_excerpt = get_the_excerpt();
      $post_image = 'http://.../default.jpg'; //default image
  
          if( $thumb_id = get_post_thumbnail_id( $post_id ) ){
              $image_attributes = wp_get_attachment_image_src( $thumb_id );
              $post_image = $image_attributes[0];
          } 
  
          /* some code here */
      }
  }
  </code></pre>
  
  <p>Let me explain the issue:</p>
  
  <p>If I use these 3 hooks I have no problem, but the code is executed before my featured image is stored into the database, so $post_image is always equals to the default image.</p>
  
  <p>If I use publish_post hook instead, featured image is set properly (maybe because this hook is called after all data have been saved), but I cannot avoid data sending to Facebook if I update my post (wp_is_post_revision seems not to be fired).</p>
  
  <p>Hope you have a good idea... now the code is almost OK! :)</p>