Hello @sverger
Thank you for your message.
As from the other topic, please try the following code instead:
add_filter( 'oembed_request_post_id', function( $post_id, $url ){
if ( $post_id ) {
return $post_id;
}
$parsed_url = wp_parse_url( $url ); // Parse URL
$slug = substr( $parsed_url['path'], 1 );
$post = get_page_by_path( $slug, OBJECT, 'product' );
if ( ! is_wp_error( $post ) && ! empty( $post ) ) {
$post_id = $post->ID;
}
return $post_id;
}, 10, 2);
Hope that helps.
Hello @sverger
Glad that helped.
Please let us know if you need any other assistance, we are here to help.
Thank you.