Automattic\WooCommerce\EmailEditor\Integrations\Core\Renderer\Blocks
Embed::get_video_thumbnail_url
Get video thumbnail URL for supported providers.
Method of the class: Embed{}
No Hooks.
Returns
String. Thumbnail URL or empty string.
Usage
// private - for code of main (parent) class only $result = $this->get_video_thumbnail_url( $url, $provider ): string;
- $url(string) (required)
- Video URL.
- $provider(string) (required)
- Provider name.
Embed::get_video_thumbnail_url() Embed::get video thumbnail url code WC 10.5.0
private function get_video_thumbnail_url( string $url, string $provider ): string {
// Currently only YouTube supports thumbnail extraction.
if ( 'youtube' === $provider ) {
return $this->get_youtube_thumbnail( $url );
}
// For other providers, we don't have thumbnail extraction implemented.
// Return empty to trigger link fallback.
return '';
}