Filter hook 'media_embedded_in_content_allowed_types'

in WP Core File wp-includes/media.php at line 5215

View Source

media_embedded_in_content_allowed_types

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

Hook Information

File Location wp-includes/media.php View on GitHub
Hook Type Filter
Line Number 5215

Hook Parameters

Type Name Description
string[] $allowed_media_types An array of allowed media types. Default media types are 'audio', 'video', 'object', 'embed', and 'iframe'.

Usage Examples

Basic Usage
<?php
// Hook into media_embedded_in_content_allowed_types
add_filter('media_embedded_in_content_allowed_types', 'my_custom_filter', 10, 1);

function my_custom_filter($allowed_media_types) {
    // Your custom filtering logic here
    return $allowed_media_types;
}

Source Code Context

wp-includes/media.php:5215 - How this hook is used in WordPress core
<?php
5210  	 * @since 4.2.0
5211  	 *
5212  	 * @param string[] $allowed_media_types An array of allowed media types. Default media types are
5213  	 *                                      'audio', 'video', 'object', 'embed', and 'iframe'.
5214  	 */
5215  	$allowed_media_types = apply_filters( 'media_embedded_in_content_allowed_types', array( 'audio', 'video', 'object', 'embed', 'iframe' ) );
5216  
5217  	if ( ! empty( $types ) ) {
5218  		if ( ! is_array( $types ) ) {
5219  			$types = array( $types );
5220  		}

PHP Documentation

<?php
/**
	 * Filters the embedded media types that are allowed to be returned from the content blob.
	 *
	 * @since 4.2.0
	 *
	 * @param string[] $allowed_media_types An array of allowed media types. Default media types are
	 *                                      'audio', 'video', 'object', 'embed', and 'iframe'.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/media.php
Related Hooks

Related hooks will be displayed here in future updates.