media_embedded_in_content_allowed_types WordPress Filter Hook

The media_embedded_in_content_allowed_types hook allows you to add additional media types that can be embedded in your content. This is useful if you want to allow users to embed video from a third-party service that is not currently supported. To use this hook, you will need to add the following code to your functions.php file: function my_custom_embedded_media_types( $allowed_types ) { $allowed_types[] = 'video/my-custom-type'; return $allowed_types; } add_filter( 'media_embedded_in_content_allowed_types', 'my_custom_embedded_media_types' );

apply_filters( 'media_embedded_in_content_allowed_types', string[] $allowed_media_types ) #

Filters the embedded media types that are allowed to be returned from the content blob.


Parameters

$allowed_media_types

(string[])An array of allowed media types. Default media types are 'audio', 'video', 'object', 'embed', and 'iframe'.


Top ↑

Source

File: wp-includes/media.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More