How to auto embedded youtube with wp_insert_post()
Youtube urls and other services that embed content in post content work via a feature called oEmbed. You need to use wp_oembed_get() to fetch the embedded content for this to work. In your case, you’re inserting content directly, so you probably don’t want to just call wp_oembed_get() and call it a day. That won’t work. … Read more