Support

Account

Home Forums Backend Issues (wp-admin) Set image as featured image Reply To: Set image as featured image

  • Thanks both of you for your replies! it’s stange to me, I did a search for _thumbnail_id but did not find any documentation on it by WordPress so I thought it was something you created!

    Thanks for the heads-up on the $value->ID @jonathan!
    I want my post thumbnail to update on existing posts as well as to add on new posts so I went to update_post_meta and removed the if statement, now I have this:

    
    //Auto assign Featured image from 'post_image'
    function acf_set_featured_image( $value, $post_id, $field  ){
      update_post_meta($post_id, '_thumbnail_id', $value->ID);
      return $value;
    }
    
    add_filter('acf/update_value/name=post_image', 'acf_set_featured_image', 10, 3);
    

    which is not working…. What am I missing? thanks again!