oembed_request_post_id
Filters the determined post ID.
Usage
add_filter( 'oembed_request_post_id', 'wp_kama_oembed_request_post_id_filter', 10, 2 ); /** * Function for `oembed_request_post_id` filter-hook. * * @param int $post_id The post ID. * @param string $url The requested URL. * * @return int */ function wp_kama_oembed_request_post_id_filter( $post_id, $url ){ // filter... return $post_id; }
- $post_id(int)
- The post ID.
- $url(string)
- The requested URL.
Changelog
Since 4.4.0 | Introduced. |
Where the hook is called
oembed_request_post_id
oembed_request_post_id
wp-includes/class-wp-oembed-controller.php 130
$post_id = apply_filters( 'oembed_request_post_id', $post_id, $request['url'] );
wp-includes/embed.php 667
$post_id = apply_filters( 'oembed_request_post_id', $post_id, $url );