WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Купить персональные IPV4 и IPV6 прокси
функция не описана

get_media_embedded_in_content() WP 3.6.0

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

Хуки из функции
Возвращает

Массив. A list of found HTML media embeds.

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

get_media_embedded_in_content( $content, $types );
$content(строка) (обязательный)
A string which might contain media data.
$types(массив)
An array of media types: 'audio', 'video', 'object', 'embed', or 'iframe'.
По умолчанию: null

Список изменений

С версии 3.6.0 Введена.

Код get media embedded in content: wp-includes/media.php WP 5.2.2

<?php
function get_media_embedded_in_content( $content, $types = null ) {
	$html = array();

	/**
	 * Filters the embedded media types that are allowed to be returned from the content blob.
	 *
	 * @since 4.2.0
	 *
	 * @param array $allowed_media_types An array of allowed media types. Default media types are
	 *                                   'audio', 'video', 'object', 'embed', and 'iframe'.
	 */
	$allowed_media_types = apply_filters( 'media_embedded_in_content_allowed_types', array( 'audio', 'video', 'object', 'embed', 'iframe' ) );

	if ( ! empty( $types ) ) {
		if ( ! is_array( $types ) ) {
			$types = array( $types );
		}

		$allowed_media_types = array_intersect( $allowed_media_types, $types );
	}

	$tags = implode( '|', $allowed_media_types );

	if ( preg_match_all( '#<(?P<tag>' . $tags . ')[^<]*?(?:>[\s\S]*?<\/(?P=tag)>|\s*\/>)#', $content, $matches ) ) {
		foreach ( $matches[0] as $match ) {
			$html[] = $match;
		}
	}

	return $html;
}