Changeset 31305
- Timestamp:
- 01/30/2015 04:05:52 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r31304 r31305 1493 1493 * @type string $preload The 'preload' attribute for the `<audio>` element. Default empty. 1494 1494 * @type string $class The 'class' attribute for the `<audio>` element. Default 'wp-audio-shortcode'. 1495 * @type string $id The 'id' attribute for the `<audio>` element. Default 'audio-{$post_id}-{$instance s}'.1495 * @type string $id The 'id' attribute for the `<audio>` element. Default 'audio-{$post_id}-{$instance}'. 1496 1496 * @type string $style The 'style' attribute for the `<audio>` element. Default 'width: 100%'. 1497 1497 * } … … 1502 1502 $post_id = get_post() ? get_the_ID() : 0; 1503 1503 1504 static $instance s= 0;1505 $instance s++;1504 static $instance = 0; 1505 $instance++; 1506 1506 1507 1507 /** … … 1512 1512 * @since 3.6.0 1513 1513 * 1514 * @param string $html 1515 * @param array $attr 1516 * @param string $content 1517 * @param int $instance sUnique numeric ID of this audio shortcode instance.1518 */ 1519 $override = apply_filters( 'wp_audio_shortcode_override', '', $attr, $content, $instance s);1514 * @param string $html Empty variable to be replaced with shortcode markup. 1515 * @param array $attr Attributes of the shortcode. @see wp_audio_shortcode() 1516 * @param string $content Shortcode content. 1517 * @param int $instance Unique numeric ID of this audio shortcode instance. 1518 */ 1519 $override = apply_filters( 'wp_audio_shortcode_override', '', $attr, $content, $instance ); 1520 1520 if ( '' !== $override ) { 1521 1521 return $override; … … 1593 1593 $html_atts = array( 1594 1594 'class' => apply_filters( 'wp_audio_shortcode_class', 'wp-audio-shortcode' ), 1595 'id' => sprintf( 'audio-%d-%d', $post_id, $instance s),1595 'id' => sprintf( 'audio-%d-%d', $post_id, $instance ), 1596 1596 'loop' => wp_validate_boolean( $atts['loop'] ), 1597 1597 'autoplay' => wp_validate_boolean( $atts['autoplay'] ), … … 1613 1613 1614 1614 $html = ''; 1615 if ( 'mediaelement' === $library && 1 === $instance s) {1615 if ( 'mediaelement' === $library && 1 === $instance ) { 1616 1616 $html .= "<!--[if lt IE 9]><script>document.createElement('audio');</script><![endif]-->\n"; 1617 1617 } … … 1626 1626 } 1627 1627 $type = wp_check_filetype( $atts[ $fallback ], wp_get_mime_types() ); 1628 $url = add_query_arg( '_', $instance s, $atts[ $fallback ] );1628 $url = add_query_arg( '_', $instance, $atts[ $fallback ] ); 1629 1629 $html .= sprintf( $source, $type['type'], esc_url( $url ) ); 1630 1630 } … … 1691 1691 * Default 'wp-video-shortcode'. 1692 1692 * @type string $id The 'id' attribute for the `<video>` element. 1693 * Default 'video-{$post_id}-{$instance s}'.1693 * Default 'video-{$post_id}-{$instance}'. 1694 1694 * } 1695 1695 * @param string $content Optional. Shortcode content. … … 1700 1700 $post_id = get_post() ? get_the_ID() : 0; 1701 1701 1702 static $instance s= 0;1703 $instance s++;1702 static $instance = 0; 1703 $instance++; 1704 1704 1705 1705 /** … … 1713 1713 * @see wp_video_shortcode() 1714 1714 * 1715 * @param string $html 1716 * @param array $attr 1717 * @param string $content 1718 * @param int $instance sUnique numeric ID of this video shortcode instance.1719 */ 1720 $override = apply_filters( 'wp_video_shortcode_override', '', $attr, $content, $instance s);1715 * @param string $html Empty variable to be replaced with shortcode markup. 1716 * @param array $attr Attributes of the video shortcode. 1717 * @param string $content Video shortcode content. 1718 * @param int $instance Unique numeric ID of this video shortcode instance. 1719 */ 1720 $override = apply_filters( 'wp_video_shortcode_override', '', $attr, $content, $instance ); 1721 1721 if ( '' !== $override ) { 1722 1722 return $override; … … 1825 1825 $html_atts = array( 1826 1826 'class' => apply_filters( 'wp_video_shortcode_class', 'wp-video-shortcode' ), 1827 'id' => sprintf( 'video-%d-%d', $post_id, $instance s),1827 'id' => sprintf( 'video-%d-%d', $post_id, $instance ), 1828 1828 'width' => absint( $atts['width'] ), 1829 1829 'height' => absint( $atts['height'] ), … … 1847 1847 1848 1848 $html = ''; 1849 if ( 'mediaelement' === $library && 1 === $instance s) {1849 if ( 'mediaelement' === $library && 1 === $instance ) { 1850 1850 $html .= "<!--[if lt IE 9]><script>document.createElement('video');</script><![endif]-->\n"; 1851 1851 } … … 1866 1866 $type = wp_check_filetype( $atts[ $fallback ], wp_get_mime_types() ); 1867 1867 } 1868 $url = add_query_arg( '_', $instance s, $atts[ $fallback ] );1868 $url = add_query_arg( '_', $instance, $atts[ $fallback ] ); 1869 1869 $html .= sprintf( $source, $type['type'], esc_url( $url ) ); 1870 1870 }
Note: See TracChangeset
for help on using the changeset viewer.