Rename `$instances` to `$instance` in wp_audio_shortcode() and wp_video_shortcode() for consistency with gallery_shortcode() and wp_playlist_shortcode().

see #31151.
Built from https://develop.svn.wordpress.org/trunk@31305


git-svn-id: http://core.svn.wordpress.org/trunk@31286 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-01-30 16:06:22 +00:00
parent fa86f3ef9c
commit 5289e92ef5
2 changed files with 23 additions and 23 deletions

View File

@ -1492,7 +1492,7 @@ function wp_get_attachment_id3_keys( $attachment, $context = 'display' ) {
* @type string $autoplay The 'autoplay' attribute for the `<audio>` element. Default empty. * @type string $autoplay The 'autoplay' attribute for the `<audio>` element. Default empty.
* @type string $preload The 'preload' attribute for the `<audio>` element. Default empty. * @type string $preload The 'preload' attribute for the `<audio>` element. Default empty.
* @type string $class The 'class' attribute for the `<audio>` element. Default 'wp-audio-shortcode'. * @type string $class The 'class' attribute for the `<audio>` element. Default 'wp-audio-shortcode'.
* @type string $id The 'id' attribute for the `<audio>` element. Default 'audio-{$post_id}-{$instances}'. * @type string $id The 'id' attribute for the `<audio>` element. Default 'audio-{$post_id}-{$instance}'.
* @type string $style The 'style' attribute for the `<audio>` element. Default 'width: 100%'. * @type string $style The 'style' attribute for the `<audio>` element. Default 'width: 100%'.
* } * }
* @param string $content Optional. Shortcode content. * @param string $content Optional. Shortcode content.
@ -1501,8 +1501,8 @@ function wp_get_attachment_id3_keys( $attachment, $context = 'display' ) {
function wp_audio_shortcode( $attr, $content = '' ) { function wp_audio_shortcode( $attr, $content = '' ) {
$post_id = get_post() ? get_the_ID() : 0; $post_id = get_post() ? get_the_ID() : 0;
static $instances = 0; static $instance = 0;
$instances++; $instance++;
/** /**
* Filter the default audio shortcode output. * Filter the default audio shortcode output.
@ -1511,12 +1511,12 @@ function wp_audio_shortcode( $attr, $content = '' ) {
* *
* @since 3.6.0 * @since 3.6.0
* *
* @param string $html Empty variable to be replaced with shortcode markup. * @param string $html Empty variable to be replaced with shortcode markup.
* @param array $attr Attributes of the shortcode. @see wp_audio_shortcode() * @param array $attr Attributes of the shortcode. @see wp_audio_shortcode()
* @param string $content Shortcode content. * @param string $content Shortcode content.
* @param int $instances Unique numeric ID of this audio shortcode instance. * @param int $instance Unique numeric ID of this audio shortcode instance.
*/ */
$override = apply_filters( 'wp_audio_shortcode_override', '', $attr, $content, $instances ); $override = apply_filters( 'wp_audio_shortcode_override', '', $attr, $content, $instance );
if ( '' !== $override ) { if ( '' !== $override ) {
return $override; return $override;
} }
@ -1592,7 +1592,7 @@ function wp_audio_shortcode( $attr, $content = '' ) {
*/ */
$html_atts = array( $html_atts = array(
'class' => apply_filters( 'wp_audio_shortcode_class', 'wp-audio-shortcode' ), 'class' => apply_filters( 'wp_audio_shortcode_class', 'wp-audio-shortcode' ),
'id' => sprintf( 'audio-%d-%d', $post_id, $instances ), 'id' => sprintf( 'audio-%d-%d', $post_id, $instance ),
'loop' => wp_validate_boolean( $atts['loop'] ), 'loop' => wp_validate_boolean( $atts['loop'] ),
'autoplay' => wp_validate_boolean( $atts['autoplay'] ), 'autoplay' => wp_validate_boolean( $atts['autoplay'] ),
'preload' => $atts['preload'], 'preload' => $atts['preload'],
@ -1612,7 +1612,7 @@ function wp_audio_shortcode( $attr, $content = '' ) {
} }
$html = ''; $html = '';
if ( 'mediaelement' === $library && 1 === $instances ) { if ( 'mediaelement' === $library && 1 === $instance ) {
$html .= "<!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->\n"; $html .= "<!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->\n";
} }
$html .= sprintf( '<audio %s controls="controls">', join( ' ', $attr_strings ) ); $html .= sprintf( '<audio %s controls="controls">', join( ' ', $attr_strings ) );
@ -1625,7 +1625,7 @@ function wp_audio_shortcode( $attr, $content = '' ) {
$fileurl = $atts[ $fallback ]; $fileurl = $atts[ $fallback ];
} }
$type = wp_check_filetype( $atts[ $fallback ], wp_get_mime_types() ); $type = wp_check_filetype( $atts[ $fallback ], wp_get_mime_types() );
$url = add_query_arg( '_', $instances, $atts[ $fallback ] ); $url = add_query_arg( '_', $instance, $atts[ $fallback ] );
$html .= sprintf( $source, $type['type'], esc_url( $url ) ); $html .= sprintf( $source, $type['type'], esc_url( $url ) );
} }
} }
@ -1690,7 +1690,7 @@ function wp_get_video_extensions() {
* @type string $class The 'class' attribute for the `<video>` element. * @type string $class The 'class' attribute for the `<video>` element.
* Default 'wp-video-shortcode'. * Default 'wp-video-shortcode'.
* @type string $id The 'id' attribute for the `<video>` element. * @type string $id The 'id' attribute for the `<video>` element.
* Default 'video-{$post_id}-{$instances}'. * Default 'video-{$post_id}-{$instance}'.
* } * }
* @param string $content Optional. Shortcode content. * @param string $content Optional. Shortcode content.
* @return string HTML content to display video. * @return string HTML content to display video.
@ -1699,8 +1699,8 @@ function wp_video_shortcode( $attr, $content = '' ) {
global $content_width; global $content_width;
$post_id = get_post() ? get_the_ID() : 0; $post_id = get_post() ? get_the_ID() : 0;
static $instances = 0; static $instance = 0;
$instances++; $instance++;
/** /**
* Filter the default video shortcode output. * Filter the default video shortcode output.
@ -1712,12 +1712,12 @@ function wp_video_shortcode( $attr, $content = '' ) {
* *
* @see wp_video_shortcode() * @see wp_video_shortcode()
* *
* @param string $html Empty variable to be replaced with shortcode markup. * @param string $html Empty variable to be replaced with shortcode markup.
* @param array $attr Attributes of the video shortcode. * @param array $attr Attributes of the video shortcode.
* @param string $content Video shortcode content. * @param string $content Video shortcode content.
* @param int $instances Unique numeric ID of this video shortcode instance. * @param int $instance Unique numeric ID of this video shortcode instance.
*/ */
$override = apply_filters( 'wp_video_shortcode_override', '', $attr, $content, $instances ); $override = apply_filters( 'wp_video_shortcode_override', '', $attr, $content, $instance );
if ( '' !== $override ) { if ( '' !== $override ) {
return $override; return $override;
} }
@ -1824,7 +1824,7 @@ function wp_video_shortcode( $attr, $content = '' ) {
*/ */
$html_atts = array( $html_atts = array(
'class' => apply_filters( 'wp_video_shortcode_class', 'wp-video-shortcode' ), 'class' => apply_filters( 'wp_video_shortcode_class', 'wp-video-shortcode' ),
'id' => sprintf( 'video-%d-%d', $post_id, $instances ), 'id' => sprintf( 'video-%d-%d', $post_id, $instance ),
'width' => absint( $atts['width'] ), 'width' => absint( $atts['width'] ),
'height' => absint( $atts['height'] ), 'height' => absint( $atts['height'] ),
'poster' => esc_url( $atts['poster'] ), 'poster' => esc_url( $atts['poster'] ),
@ -1846,7 +1846,7 @@ function wp_video_shortcode( $attr, $content = '' ) {
} }
$html = ''; $html = '';
if ( 'mediaelement' === $library && 1 === $instances ) { if ( 'mediaelement' === $library && 1 === $instance ) {
$html .= "<!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->\n"; $html .= "<!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->\n";
} }
$html .= sprintf( '<video %s controls="controls">', join( ' ', $attr_strings ) ); $html .= sprintf( '<video %s controls="controls">', join( ' ', $attr_strings ) );
@ -1865,7 +1865,7 @@ function wp_video_shortcode( $attr, $content = '' ) {
} else { } else {
$type = wp_check_filetype( $atts[ $fallback ], wp_get_mime_types() ); $type = wp_check_filetype( $atts[ $fallback ], wp_get_mime_types() );
} }
$url = add_query_arg( '_', $instances, $atts[ $fallback ] ); $url = add_query_arg( '_', $instance, $atts[ $fallback ] );
$html .= sprintf( $source, $type['type'], esc_url( $url ) ); $html .= sprintf( $source, $type['type'], esc_url( $url ) );
} }
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.2-alpha-31304'; $wp_version = '4.2-alpha-31305';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.