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'.
Source
File: wp-includes/media.php
Changelog
Version | Description |
---|---|
4.2.0 | Introduced. |