get_media_embedded_in_content( string $content, string[] $types = null ): string[]

In this article

Checks the HTML content for an audio, video, object, embed, or iframe tags.

Parameters

$contentstringrequired
A string of HTML which might contain media elements.
$typesstring[]optional
An array of media types: 'audio', 'video', 'object', 'embed', or 'iframe'.

Default:null

Return

string[] Array of found HTML media elements.

Source

 * Filters the media view strings.
 *
 * @since 3.5.0
 *
 * @param string[] $strings Array of media view strings keyed by the name they'll be referenced by in JavaScript.
 * @param WP_Post  $post    Post object.
 */
$strings = apply_filters( 'media_view_strings', $strings, $post );

$strings['settings'] = $settings;

/*
 * Ensure we enqueue media-editor first, that way media-views
 * is registered internally before we try to localize it. See #24724.
 */
wp_enqueue_script( 'media-editor' );
wp_localize_script( 'media-views', '_wpMediaViewsL10n', $strings );

wp_enqueue_script( 'media-audiovideo' );
wp_enqueue_style( 'media-views' );
if ( is_admin() ) {
	wp_enqueue_script( 'mce-view' );
	wp_enqueue_script( 'image-edit' );
}
wp_enqueue_style( 'imgareaselect' );
wp_plupload_default_settings();

require_once ABSPATH . WPINC . '/media-template.php';
add_action( 'admin_footer', 'wp_print_media_templates' );
add_action( 'wp_footer', 'wp_print_media_templates' );
add_action( 'customize_controls_print_footer_scripts', 'wp_print_media_templates' );

Changelog

VersionDescription
3.6.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.