Create featured image from a remote url when creating a post
The code worked for me; but I defined the function like this: function generate_featured( $post_id ), then I commented out the global $post;; and finally (although this is not mandatory..), in the $file_array, I set name like this: ‘name’ => basename( $image_url ), So: (Note that I intentionally didn’t include the whole code) function generate_featured( … Read more