[wp-trac] [WordPress Trac] #28619: Add more filters to tune audio and video shortcode library
WordPress Trac
noreply at wordpress.org
Tue Jun 24 08:42:26 UTC 2014
#28619: Add more filters to tune audio and video shortcode library
-------------------------+-----------------------------
Reporter: Fab1en | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Media | Version: 3.9.1
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
`wp_video_shortcode_library` and `wp_audio_shortcode_library` allow a
plugin author to replace the default mediaelement.js library by another
Audio/Video js library. But then, possibilities to modify the html
rendering are very limited.
I have identified 2 points where a filter/action is needed :
1. L1782 in wp-includes/media.php
(https://github.com/WordPress/WordPress/blob/3.9.1/wp-
includes/media.php#L1792)
{{{
$html = '';
if ( 'mediaelement' === $library && 1 === $instances )
$html .= "<!--[if lt IE
9]><script>document.createElement('video');</script><![endif]-->\n";
}}}
2. L1820 in wp-includes/media.php
(https://github.com/WordPress/WordPress/blob/3.9.1/wp-
includes/media.php#L1820)
{{{
if ( 'mediaelement' === $library )
$html .= wp_mediaelement_fallback( $fileurl );
}}}
Plugin author should be able to add arbitrary HTML code before and inside
the `<video>` tag as easily as this is done for mediaelement.
This could be done by replacing the previous lines with an filter call,
and doing the mediaelement stuff inside the filter callback that can be
unregistered and replaced by plugins.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28619>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list