Filter hook 'wp_mediaelement_fallback'

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

View Source

wp_mediaelement_fallback

Filter Hook
Description
Filters the MediaElement fallback output for no-JS.

Hook Information

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

Hook Parameters

Type Name Description
string $output Fallback output for no-JS.
string $url Media file URL.

Usage Examples

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

function my_custom_filter($output, $url) {
    // Your custom filtering logic here
    return $output;
}

Source Code Context

wp-includes/media.php:3290 - How this hook is used in WordPress core
<?php
3285  	 * @since 3.6.0
3286  	 *
3287  	 * @param string $output Fallback output for no-JS.
3288  	 * @param string $url    Media file URL.
3289  	 */
3290  	return apply_filters( 'wp_mediaelement_fallback', sprintf( '<a href="%1$s">%1$s</a>', esc_url( $url ) ), $url );
3291  }
3292  
3293  /**
3294   * Returns a filtered list of supported audio formats.
3295   *

PHP Documentation

<?php
/**
	 * Filters the MediaElement fallback output for no-JS.
	 *
	 * @since 3.6.0
	 *
	 * @param string $output Fallback output for no-JS.
	 * @param string $url    Media file URL.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/media.php
Related Hooks

Related hooks will be displayed here in future updates.