post_embed_url
Filters the URL to embed a specific post.
Usage
add_filter( 'post_embed_url', 'wp_kama_post_embed_url_filter', 10, 2 );
/**
* Function for `post_embed_url` filter-hook.
*
* @param string $embed_url The post embed URL.
* @param WP_Post $post The corresponding post object.
*
* @return string
*/
function wp_kama_post_embed_url_filter( $embed_url, $post ){
// filter...
return $embed_url;
}
- $embed_url(string)
- The post embed URL.
- $post(WP_Post)
- The corresponding post object.
Changelog
| Since 4.4.0 | Introduced. |
Where the hook is called
post_embed_url
wp-includes/embed.php 441
return sanitize_url( apply_filters( 'post_embed_url', $embed_url, $post ) );