wp_mediaelement_fallback() WordPress Function

The wp_mediaelement_fallback() function provides a fallback for browsers that do not support the MediaElement.js player. MediaElement.js is a free and open source HTML5 video and audio player that supports a wide range of video and audio formats. If a browser does not support MediaElement.js, the fallback will display a link to the media file.

wp_mediaelement_fallback( string $url ) #

Provides a No-JS Flash fallback as a last resort for audio / video.


Parameters

$url

(string)(Required)The media element URL.


Top ↑

Return

(string) Fallback HTML.


Top ↑

Source

File: wp-includes/media.php

function wp_mediaelement_fallback( $url ) {
	/**
	 * 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.
	 */
	return apply_filters( 'wp_mediaelement_fallback', sprintf( '<a href="%1$s">%1$s</a>', esc_url( $url ) ), $url );
}


Top ↑

Changelog

Changelog
VersionDescription
3.6.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