Function: get_media_embedded_in_content

get_media_embedded_in_content( string $content, array $types )

Check the content blob for an audio, video, object, embed, or iframe tags.

Parameters

Name Type(s) Default Value Description
$content string

A string which might contain media data.

$types array null

An array of media types: 'audio', 'video', 'object', 'embed', or 'iframe'.

Returns

array

A list of found HTML media embeds.

WordPress Developer Newsletter

Stay on top of the latest WordPress API changes, developer tool updates, security alerts and more.