Function: get_post_embed_url

get_post_embed_url( integer | WP_Post $post )

Retrieves the URL to embed a specific post in an iframe.


Name Type(s) Default Value Description
$post integer | WP_Post null

Optional. Post ID or object. Defaults to the current post.


string | false

The post embed URL on success, false if the post doesn't exist.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.