oembed_request_post_id filter-hookWP 4.4.0

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

WP_oEmbed_Controller::get_item()
oembed_request_post_id
get_oembed_response_data_for_url()
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 );

Where the hook is used in WordPress

Usage not found.