WordPress как на ладони
wordpress jino
фильтр не описан

oembed_request_post_id хук-фильтр . WP 4.4.0

Filters the determined post ID.

Использование

add_filter( 'oembed_request_post_id', 'filter_function_name_9872', 10, 2 );
function filter_function_name_9872( $post_id, $request['url'] ){
	// filter...

	return $post_id;
}
$post_id(int)
The post ID.
$url(string)
The requested URL.

Связи хука

Используется в: wp_filter_pre_oembed_result(), WP_oEmbed_Controller::get_item()

Кусок кода с хуком

Фрагмент из: wp-includes/embed.php WP 4.9
...
			}
		}

		$sites = get_sites( $qv );
		$site  = reset( $sites );

		if ( $site && (int) $site->blog_id !== get_current_blog_id() ) {
			switch_to_blog( $site->blog_id );
			$switched_blog = true;
		}
	}

	$post_id = url_to_postid( $url );

	/** This filter is documented in wp-includes/class-wp-oembed-controller.php */
	$post_id = apply_filters( 'oembed_request_post_id', $post_id, $url );

	if ( ! $post_id ) {
		if ( $switched_blog ) {
			restore_current_blog();
		}

		return $result;
	}

	$width = isset( $args['width'] ) ? $args['width'] : 0;

	$data = get_oembed_response_data( $post_id, $width );
	$data = _wp_oembed_get_object()->data2html( (object) $data, $url );

	if ( $switched_blog ) {
...
Фрагмент из: wp-includes/class-wp-oembed-controller.php WP 4.9
...
	 *
	 * @param WP_REST_Request $request Full data about the request.
	 * @return WP_Error|array oEmbed response data or WP_Error on failure.
	 */
	public function get_item( $request ) {
		$post_id = url_to_postid( $request['url'] );

		/**
		 * Filters the determined post ID.
		 *
		 * @since 4.4.0
		 *
		 * @param int    $post_id The post ID.
		 * @param string $url     The requested URL.
		 */
		$post_id = apply_filters( 'oembed_request_post_id', $post_id, $request['url'] );

		$data = get_oembed_response_data( $post_id, $request['maxwidth'] );

		if ( ! $data ) {
			return new WP_Error( 'oembed_invalid_url', get_status_header_desc( 404 ), array( 'status' => 404 ) );
		}

		return $data;
	}

	/**
	 * Checks if current user can make a proxy oEmbed request.
	 *
	 * @since 4.8.0
	 *
...