Make the arguments of 'wp_audio_shortcode_override' and 'wp_video_shortcode_override' more consistent with the ones of 'img_caption_shortcode' and 'post_gallery' filters.

see #25313.
Built from https://develop.svn.wordpress.org/trunk@25485


git-svn-id: http://core.svn.wordpress.org/trunk@25406 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2013-09-18 22:06:09 +00:00
parent dd6e39bfb1
commit 7c5d11d671
1 changed files with 18 additions and 14 deletions

View File

@ -874,9 +874,10 @@ function wp_get_audio_extensions() {
* @since 3.6.0
*
* @param array $attr Attributes of the shortcode.
* @param string $content Optional. Shortcode content.
* @return string HTML content to display audio.
*/
function wp_audio_shortcode( $attr ) {
function wp_audio_shortcode( $attr, $content = '' ) {
$post_id = get_post() ? get_the_ID() : 0;
static $instances = 0;
@ -889,10 +890,11 @@ function wp_audio_shortcode( $attr ) {
*
* @param null Empty variable to be replaced with shortcode markup.
* @param array $attr Attributes of the shortcode.
* @param string $content Shortcode content.
* @param int $instances Unique numeric ID of this audio shortcode instance.
*/
$html = apply_filters( 'wp_audio_shortcode_override', null, $attr, $instances );
if ( null !== $html )
$html = apply_filters( 'wp_audio_shortcode_override', '', $attr, $content, $instances );
if ( '' !== $html )
return $html;
$audio = null;
@ -1009,9 +1011,10 @@ function wp_get_video_extensions() {
* @since 3.6.0
*
* @param array $attr Attributes of the shortcode.
* @param string $content Optional. Shortcode content.
* @return string HTML content to display video.
*/
function wp_video_shortcode( $attr ) {
function wp_video_shortcode( $attr, $content = '' ) {
global $content_width;
$post_id = get_post() ? get_the_ID() : 0;
@ -1025,10 +1028,11 @@ function wp_video_shortcode( $attr ) {
*
* @param null Empty variable to be replaced with shortcode markup.
* @param array $attr Attributes of the shortcode.
* @param string $content Shortcode content.
* @param int $instances Unique numeric ID of this video shortcode instance.
*/
$html = apply_filters( 'wp_video_shortcode_override', null, $attr, $instances );
if ( null !== $html )
$html = apply_filters( 'wp_video_shortcode_override', '', $attr, $content, $instances );
if ( '' !== $html )
return $html;
$video = null;