Make WordPress Core

Ticket #23282: 23282.10.diff

File 23282.10.diff, 20.6 KB (added by wonderboymusic, 12 years ago)
  • wp-admin/includes/ajax-actions.php

    diff --git wp-admin/includes/ajax-actions.php wp-admin/includes/ajax-actions.php
    index 8581c9e..93a897f 100644
    function wp_ajax_send_attachment_to_editor() { 
    20242024                $caption = isset( $attachment['post_excerpt'] ) ? $attachment['post_excerpt'] : '';
    20252025                $title = ''; // We no longer insert title tags into <img> tags, as they are redundant.
    20262026                $html = get_image_send_to_editor( $id, $caption, $title, $align, $url, (bool) $rel, $size, $alt );
     2027        } elseif ( 'video' === substr( $post->post_mime_type, 0, 5 ) || 'audio' === substr( $post->post_mime_type, 0, 5 )  ) {
     2028                $html = stripslashes_deep( $_POST['html'] );
    20272029        }
    20282030
    20292031        $html = apply_filters( 'media_send_to_editor', $html, $id, $attachment );
  • wp-includes/functions.php

    diff --git wp-includes/functions.php wp-includes/functions.php
    index b29b941..78dedb6 100644
    $("#wp-auth-check-form iframe").load(function(){ 
    40204020</script>
    40214021</div>' ) );
    40224022}
     4023
     4024/**
     4025 * Return RegEx body to liberally match an opening HTML tag that:
     4026 * 1. Is self-closing or
     4027 * 2. Has no body but has a closing tag of the same name or
     4028 * 3. Contains a body and a closing tag of the same name
     4029 *
     4030 * Note: this RegEx does not balance inner tags and does not attempt to produce valid HTML
     4031 *
     4032 * @since 3.6.0
     4033 *
     4034 * @param string $tag An HTML tag name. Example: 'video'
     4035 * @return string
     4036 */
     4037function get_tag_regex( $tag ) {
     4038        if ( empty( $tag ) )
     4039                return;
     4040
     4041        return sprintf( '(<%1$s[^>]*(?:/?>$|>[\s\S]*?</%1$s>))', tag_escape( $tag ) );
     4042}
     4043 No newline at end of file
  • wp-includes/js/media-editor.js

    diff --git wp-includes/js/media-editor.js wp-includes/js/media-editor.js
    index 15eff8d..7dbbb79 100644
     
    6666                                        src:       size.url,
    6767                                        captionId: 'attachment_' + attachment.id
    6868                                });
    69 
     69                        } else if ( 'video' === attachment.type || 'audio' === attachment.type ) {
     70                                _.extend( props, _.pick( attachment, 'title', 'type', 'icon', 'mime' ) );
    7071                        // Format properties for non-images.
    7172                        } else {
    7273                                props.title = props.title || attachment.filename;
     
    9596                        return wp.html.string( options );
    9697                },
    9798
     99                audio: function( props, attachment ) {
     100                        var shortcode, html;
     101
     102                        props = wp.media.string.props( props, attachment );
     103
     104                        shortcode = {};
     105
     106                        if ( props.mime ) {
     107                                switch ( props.mime ) {
     108                                case 'audio/mpeg':
     109                                        if ( props.linkUrl.indexOf( 'mp3' ) )
     110                                                shortcode.mp3 = props.linkUrl;
     111                                        else if ( props.linkUrl.indexOf( 'm4a' ) )
     112                                                shortcode.m4a = props.linkUrl;
     113                                        break;
     114                                case 'audio/mp3':
     115                                        shortcode.mp3 = props.linkUrl;
     116                                        break;
     117                                case 'audio/m4a':
     118                                        shortcode.m4a = props.linkUrl;
     119                                        break;
     120                                case 'audio/wav':
     121                                        shortcode.wav = props.linkUrl;
     122                                        break;
     123                                case 'audio/ogg':
     124                                        shortcode.ogg = props.linkUrl;
     125                                        break;
     126                                case 'audio/x-ms-wma':
     127                                case 'audio/wma':
     128                                        shortcode.wma = props.linkUrl;
     129                                        break;
     130                                }
     131                        }
     132
     133                        html = wp.shortcode.string({
     134                                tag:     'audio',
     135                                attrs:   shortcode
     136                        });
     137
     138                        return html;
     139                },
     140
     141                video: function( props, attachment ) {
     142                        var shortcode, html;
     143
     144                        props = wp.media.string.props( props, attachment );
     145
     146                        shortcode = {};
     147
     148                        if ( props.mime ) {
     149                                switch ( props.mime ) {
     150                                case 'video/mp4':
     151                                        shortcode.mp4 = props.linkUrl;
     152                                        break;
     153                                case 'video/m4v':
     154                                        shortcode.m4v = props.linkUrl;
     155                                        break;
     156                                case 'video/webm':
     157                                        shortcode.webm = props.linkUrl;
     158                                        break;
     159                                case 'video/ogg':
     160                                        shortcode.ogv = props.linkUrl;
     161                                        break;
     162                                case 'video/x-ms-wmv':
     163                                case 'video/wmv':
     164                                case 'video/asf':
     165                                        shortcode.wmv = props.linkUrl;
     166                                        break;
     167                                case 'video/flv':
     168                                case 'video/x-flv':
     169                                        shortcode.flv = props.linkUrl;
     170                                        break;
     171                                }
     172                        }
     173
     174                        html = wp.shortcode.string({
     175                                tag:     'video',
     176                                attrs:   shortcode
     177                        });
     178
     179                        return html;
     180                },
     181
    98182                image: function( props, attachment ) {
    99183                        var img = {},
    100184                                options, classes, shortcode, html;
     
    575659                                                if ( props[ prop ] )
    576660                                                        options[ option ] = props[ prop ];
    577661                                        });
    578 
     662                                } else if ( 'video' === attachment.type ) {
     663                                        html = wp.media.string.video( props );
     664                                } else if ( 'audio' === attachment.type ) {
     665                                        html = wp.media.string.audio( props );
    579666                                } else {
    580667                                        html = wp.media.string.link( props );
    581668                                        options.post_title = props.title;
  • wp-includes/media.php

    diff --git wp-includes/media.php wp-includes/media.php
    index f1f3737..c4d5a56 100644
    function gallery_shortcode($attr) { 
    803803}
    804804
    805805/**
     806 * Return a filtered list of WP-supported audio formats
     807 *
     808 * @since 3.6.0
     809 * @return array
     810 */
     811function wp_get_audio_extensions() {
     812        return apply_filters( 'wp_audio_extensions', array( 'mp3', 'ogg', 'wma', 'm4a', 'wav' ) );
     813}
     814
     815/**
     816 * The Audio shortcode.
     817 *
     818 * This implements the functionality of the Audio Shortcode for displaying
     819 * WordPress mp3s in a post.
     820 *
     821 * @since 3.6.0
     822 *
     823 * @param array $attr Attributes of the shortcode.
     824 * @return string HTML content to display audio.
     825 */
     826function wp_audio_shortcode( $attr ) {
     827        $post_id = get_post() ? get_the_ID() : 0;
     828
     829        static $instances = 0;
     830        $instances++;
     831
     832        $audio = null;
     833
     834        $default_types = wp_get_audio_extensions();
     835        $defaults_atts = array( 'src' => '' );
     836        foreach ( $default_types as $type  )
     837                $defaults_atts[$type] = '';
     838
     839        extract( shortcode_atts( $defaults_atts, $attr ) );
     840
     841        $primary = false;
     842        if ( ! empty( $src ) ) {
     843                $type = wp_check_filetype( $src );
     844                if ( ! in_array( $type['ext'], $default_types ) ) {
     845                        printf( '<a class="wp-post-format-link-audio" href="%1$s">%1$s</a>', $src );
     846                        return;
     847                }
     848                $primary = true;
     849                array_unshift( $default_types, 'src' );
     850        } else {
     851                foreach ( $default_types as $ext ) {
     852                        if ( ! empty( $$ext ) ) {
     853                                $type = wp_check_filetype( $$ext );
     854                                if ( $type['ext'] === $ext )
     855                                        $primary = true;
     856                        }
     857                }
     858        }
     859
     860        if ( ! $primary ) {
     861                $audios = get_post_audio( $post_id );
     862                if ( empty( $audios ) )
     863                        return;
     864
     865                $audio = reset( $audios );
     866                $src = wp_get_attachment_url( $audio->ID );
     867                if ( empty( $src ) )
     868                        return;
     869
     870                array_unshift( $default_types, 'src' );
     871        }
     872
     873        wp_enqueue_style( 'wp-mediaelement' );
     874        wp_enqueue_script( 'wp-mediaelement' );
     875
     876        $atts = array(
     877                sprintf( 'class="%s"', apply_filters( 'wp_audio_shortcode_class', 'wp-audio-shortcode' ) ),
     878                sprintf( 'id="audio-%d-%d"', $post_id, $instances ),
     879        );
     880
     881        $html = sprintf( '<audio %s controls="controls" preload="none">', join( ' ', $atts ) );
     882
     883        $source = '<source type="%s" src="%s" />';
     884        foreach ( $default_types as $fallback ) {
     885                if ( ! empty( $$fallback ) ) {
     886                        $type = wp_check_filetype( $$fallback );
     887                        $html .= sprintf( $source, $type['type'], $$fallback );
     888                }
     889        }
     890
     891        $html .= '</audio>';
     892
     893        return apply_filters( 'wp_audio_shortcode', $html, $src, $audio, $post_id );
     894}
     895add_shortcode( 'audio', 'wp_audio_shortcode' );
     896
     897/**
     898 * Return a filtered list of WP-supported video formats
     899 *
     900 * @since 3.6.0
     901 * @return array
     902 */
     903function wp_get_video_extensions() {
     904        return apply_filters( 'wp_video_extensions', array( 'mp4', 'm4v', 'webm', 'ogv', 'wmv', 'flv' ) );
     905}
     906
     907/**
     908 * The Video shortcode.
     909 *
     910 * This implements the functionality of the Video Shortcode for displaying
     911 * WordPress mp4s in a post.
     912 *
     913 * @since 3.6.0
     914 *
     915 * @param array $attr Attributes of the shortcode.
     916 * @return string HTML content to display video.
     917 */
     918function wp_video_shortcode( $attr ) {
     919        global $content_width;
     920        $post_id = get_post() ? get_the_ID() : 0;
     921
     922        static $instances = 0;
     923        $instances++;
     924
     925        $video = null;
     926
     927        $default_types = wp_get_video_extensions();
     928        $defaults_atts = array(
     929                'src' => '',
     930                'poster' => '',
     931                'height' => 360,
     932                'width' => empty( $content_width ) ? 640 : $content_width,
     933        );
     934        foreach ( $default_types as $type  )
     935                $defaults_atts[$type] = '';
     936
     937        extract( shortcode_atts( $defaults_atts, $attr ) );
     938
     939        $primary = false;
     940        if ( ! empty( $src ) ) {
     941                $type = wp_check_filetype( $src );
     942                if ( ! in_array( $type['ext'], $default_types ) ) {
     943                        printf( '<a class="wp-post-format-link-video" href="%1$s">%1$s</a>', $src );
     944                        return;
     945                }
     946                $primary = true;
     947                array_unshift( $default_types, 'src' );
     948        } else {
     949                foreach ( $default_types as $ext ) {
     950                        if ( ! empty( $$ext ) ) {
     951                                $type = wp_check_filetype( $$ext );
     952                                if ( $type['ext'] === $ext )
     953                                        $primary = true;
     954                        }
     955                }
     956        }
     957
     958        if ( ! $primary ) {
     959                $videos = get_post_video( $post_id );
     960                if ( empty( $videos ) )
     961                        return;
     962
     963                $video = reset( $videos );
     964                $src = wp_get_attachment_url( $video->ID );
     965                if ( empty( $src ) )
     966                        return;
     967
     968                array_unshift( $default_types, 'src' );
     969        }
     970
     971        wp_enqueue_style( 'wp-mediaelement' );
     972        wp_enqueue_script( 'wp-mediaelement' );
     973
     974        $atts = array(
     975                sprintf( 'class="%s"', apply_filters( 'video_shortcode_class', 'wp-video-shortcode' ) ),
     976                sprintf( 'id="video-%d-%d"', $post_id, $instances ),
     977                sprintf( 'width="%d"', $width ),
     978                sprintf( 'height="%d"', $height ),
     979        );
     980
     981        if ( ! empty( $poster ) )
     982                $atts[] = sprintf( 'poster="%s"', esc_url( $poster ) );
     983
     984        $html = sprintf( '<video %s controls="controls" preload="none">', join( ' ', $atts ) );
     985
     986        $source = '<source type="%s" src="%s" />';
     987        foreach ( $default_types as $fallback ) {
     988                if ( ! empty( $$fallback ) ) {
     989                        $type = wp_check_filetype( $$fallback );
     990                        // m4v sometimes shows up as video/mpeg which collides with mp4
     991                        if ( 'm4v' === $type['ext'] )
     992                                $type['type'] = 'video/m4v';
     993                        $html .= sprintf( $source, $type['type'], $$fallback );
     994                }
     995        }
     996
     997        $html .= '</video>';
     998
     999        return apply_filters( 'wp_video_shortcode', $html, $src, $video, $post_id );
     1000}
     1001add_shortcode( 'video', 'wp_video_shortcode' );
     1002
     1003/**
    8061004 * Display previous image link that has the same post parent.
    8071005 *
    8081006 * @since 2.5.0
    function wp_enqueue_media( $args = array() ) { 
    15421740
    15431741        do_action( 'wp_enqueue_media' );
    15441742}
     1743
     1744/**
     1745 * Retrieve audio attached to the passed post
     1746 *
     1747 * @since 3.6.0
     1748 *
     1749 * @param int $post_id  Post ID
     1750 * @return array Found audio attachments
     1751 */
     1752function get_post_audio( $post_id = 0 ) {
     1753        $post = empty( $post_id ) ? get_post() : get_post( $post_id );
     1754        if ( empty( $post ) )
     1755                return;
     1756
     1757        $children = get_children( array(
     1758                'post_parent' => $post->ID,
     1759                'post_type' => 'attachment',
     1760                'post_mime_type' => 'audio',
     1761                'posts_per_page' => -1
     1762        ) );
     1763
     1764        if ( ! empty( $children ) )
     1765                return $children;
     1766}
     1767
     1768/**
     1769 * Check the content blob for an <audio>, <object>, <embed>, or <iframe>, in that order
     1770 * If no HTML tag is found, check the first line of the post for a URL
     1771 *
     1772 * @param string $content A string which might contain audio data.
     1773 * @param boolean $remove Whether to remove the found URL from the passed content.
     1774 * @return string The found data
     1775 */
     1776function get_content_audio( &$content, $remove = false ) {
     1777        $html = $matches = '';
     1778        foreach ( array( 'audio', 'object', 'embed', 'iframe' ) as $tag ) {
     1779                if ( preg_match( '#' . get_tag_regex( $tag ) . '#i', $content, $matches ) ) {
     1780                        $html = $matches[1];
     1781                        $count = 1;
     1782                        if ( $remove )
     1783                                $content = str_replace( $matches[0], '', $content, $count );
     1784
     1785                        return $html;
     1786                }
     1787        }
     1788
     1789        $lines = explode( "\n", trim( $content ) );
     1790        $line = trim( array_shift( $lines ) );
     1791
     1792        if ( 0 === stripos( $line, 'http' ) ) {
     1793                if ( $remove )
     1794                        $content = join( "\n", $lines );
     1795
     1796                return $line;
     1797        }
     1798}
     1799
     1800/**
     1801 * Return the found audio data for the passed post
     1802 *
     1803 * @since 3.6.0
     1804 *
     1805 * @param int $id Optional. Post ID
     1806 */
     1807function get_the_audio( $id = 0 ) {
     1808        $post = empty( $id ) ? get_post() : get_post( $id );
     1809        if ( empty( $post ) )
     1810                return array();
     1811
     1812        $data = get_content_audio( $post->post_content );
     1813        if ( ! empty( $data ) )
     1814                return $data;
     1815
     1816        $audios = get_post_audio( $post->ID );
     1817        if ( empty( $audios ) )
     1818                return array();
     1819
     1820        $audio = reset( $audios );
     1821        return wp_get_attachment_url( $audio->ID );
     1822}
     1823
     1824/**
     1825 * Output the found audio data for the current post
     1826 *
     1827 * @since 3.6.0
     1828 */
     1829function the_audio() {
     1830        echo apply_filters( 'the_audio', get_the_audio() );
     1831}
     1832
     1833/**
     1834 * Retrieve video attached to the passed post
     1835 *
     1836 * @since 3.6.0
     1837 *
     1838 * @param int $post_id  Post ID
     1839 * @return array Found video attachments
     1840 */
     1841function get_post_video( $post_id = 0 ) {
     1842        $post = empty( $post_id ) ? get_post() : get_post( $post_id );
     1843        if ( empty( $post ) )
     1844                return;
     1845
     1846        $children = get_children( array(
     1847                'post_parent' => $post->ID,
     1848                'post_type' => 'attachment',
     1849                'post_mime_type' => 'video',
     1850                'posts_per_page' => -1
     1851        ) );
     1852
     1853        if ( ! empty( $children ) )
     1854                return $children;
     1855}
     1856
     1857/**
     1858 * Check the content blob for a <video>, <object>, <embed>, or <iframe>, in that order
     1859 * If no HTML tag is found, check the first line of the post for a URL
     1860 *
     1861 * @param string $content A string which might contain video data.
     1862 * @param boolean $remove Whether to remove the found URL from the passed content.
     1863 * @return string The found data
     1864 */
     1865function get_content_video( &$content, $remove = false ) {
     1866        $html = $matches = '';
     1867        foreach ( array( 'video', 'object', 'embed', 'iframe' ) as $tag ) {
     1868                if ( preg_match( '#' . get_tag_regex( $tag ) . '#i', $content, $matches ) ) {
     1869                        $html = $matches[1];
     1870                        $count = 1;
     1871                        if ( $remove )
     1872                                $content = str_replace( $matches[0], '', $content, $count );
     1873
     1874                        return $html;
     1875                }
     1876        }
     1877
     1878        $lines = explode( "\n", trim( $content ) );
     1879        $line = trim( array_shift( $lines  ) );
     1880
     1881        if ( 0 === stripos( $line, 'http' ) ) {
     1882                if ( $remove )
     1883                        $content = join( "\n", $lines );
     1884
     1885                return $line;
     1886        }
     1887}
     1888
     1889/**
     1890 * Return the found video data for the passed post
     1891 *
     1892 * @since 3.6.0
     1893 *
     1894 * @param int $id Optional. Post ID
     1895 * @return string A video URL or embed code, if present.
     1896 */
     1897function get_the_video( $id = 0 ) {
     1898        $post = empty( $id ) ? get_post() : get_post( $id );
     1899        if ( empty( $post ) )
     1900                return '';
     1901
     1902        $data = get_content_video( $post->post_content );
     1903        if ( ! empty( $data ) )
     1904                return $data;
     1905
     1906        $videos = get_post_video( $post->ID );
     1907        if ( empty( $videos ) )
     1908                return '';
     1909
     1910        $video = reset( $videos );
     1911        return wp_get_attachment_url( $video->ID );
     1912}
     1913
     1914/**
     1915 * Output the found video data for the current post
     1916 *
     1917 * @since 3.6.0
     1918 */
     1919function the_video() {
     1920        echo apply_filters( 'the_video', get_the_video() );
     1921}
     1922
     1923/**
     1924 * Audio embed handler callback.
     1925 *
     1926 * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.
     1927 * @param array $attr Embed attributes.
     1928 * @param string $url The original URL that was matched by the regex.
     1929 * @param array $rawattr The original unmodified attributes.
     1930 * @return string The embed HTML.
     1931 */
     1932function wp_audio_embed( $matches, $attr, $url, $rawattr ) {
     1933        $audio = do_shortcode( '[audio src="' . $url . '" /]' );
     1934        return apply_filters( 'wp_audio_embed', $audio, $attr, $url, $rawattr );
     1935}
     1936wp_embed_register_handler( 'wp_audio_embed', '#https?://.+?\.(' . join( '|', wp_get_audio_extensions() ) . ')#i', 'wp_audio_embed', 9999 );
     1937
     1938/**
     1939 * Video embed handler callback.
     1940 *
     1941 * @param array $matches The regex matches from the provided regex when calling {@link wp_embed_register_handler()}.
     1942 * @param array $attr Embed attributes.
     1943 * @param string $url The original URL that was matched by the regex.
     1944 * @param array $rawattr The original unmodified attributes.
     1945 * @return string The embed HTML.
     1946 */
     1947function wp_video_embed( $matches, $attr, $url, $rawattr ) {
     1948        $dimensions = '';
     1949        if ( ! empty( $rawattr['width'] ) && ! empty( $rawattr['height'] ) ) {
     1950                $dimensions .= sprintf( 'width="%d" ', (int) $rawattr['width'] );
     1951                $dimensions .= sprintf( 'height="%d" ', (int) $rawattr['height'] );
     1952        }
     1953        $video = do_shortcode( '[video ' . $dimensions . 'src="' . $url . '" /]' );
     1954        return apply_filters( 'wp_video_embed', $video, $attr, $url, $rawattr );
     1955}
     1956wp_embed_register_handler( 'wp_video_embed', '#https?://.+?\.(' . join( '|', wp_get_video_extensions() ) . ')#i', 'wp_video_embed', 9999 );
     1957 No newline at end of file
  • wp-includes/post-formats.php

    diff --git wp-includes/post-formats.php wp-includes/post-formats.php
    index 828447b..7dfc171 100644
    function post_formats_compat( $content, $id = 0 ) { 
    308308        $show_content = true;
    309309        $format_output = '';
    310310        $meta = get_post_format_meta( $post->ID );
     311        // passed by ref in preg_match()
     312        $matches = array();
    311313
    312314        switch ( $format ) {
    313315                case 'link':
    function post_formats_compat( $content, $id = 0 ) { 
    365367                        break;
    366368
    367369                case 'gallery':
    368                         preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches );
    369                         if ( ! empty( $matches ) && isset( $matches[2] ) ) {
    370                                 foreach ( (array) $matches[2] as $match ) {
    371                                         if ( 'gallery' === $match )
    372                                                 break 2; // foreach + case
    373                                 }
    374                         }
    375 
    376                         if ( ! empty( $meta['gallery'] ) ) {
     370                        if ( ! has_shortcode( $post->post_content, $format ) && ! empty( $meta['gallery'] ) )
    377371                                $format_output .= $meta['gallery'];
    378                         }
    379372                        break;
    380373
    381374                case 'video':
    382375                case 'audio':
    383                         $shortcode_regex = '/' . get_shortcode_regex() . '/s';
    384                         $matches = preg_match( $shortcode_regex, $content );
    385                         if ( ! $matches || $format !== $matches[2] ) {
    386                                 if ( ! empty( $meta['media'] ) ) {
    387                                         // the metadata is a shortcode or an embed code
    388                                         if ( preg_match( $shortcode_regex, $meta['media'] ) || preg_match( '#<[^>]+>#', $meta['media'] ) ) {
    389                                                 $format_output .= $meta['media'];
    390                                         } elseif ( ! stristr( $content, $meta['media'] ) ) {
    391                                                 // attempt to embed the URL
    392                                                 $format_output .= sprintf( '[embed]%s[/embed]', $meta['media'] );
    393                                         }
     376                        if ( ! has_shortcode( $post->post_content, $format ) && ! empty( $meta['media'] ) ) {
     377                                // the metadata is a shortcode or an embed code
     378                                if ( preg_match( '/' . get_shortcode_regex() . '/s', $meta['media'] ) || preg_match( '#<[^>]+>#', $meta['media'] ) ) {
     379                                        $format_output .= $meta['media'];
     380                                } elseif ( ! stristr( $content, $meta['media'] ) ) {
     381                                        // attempt to embed the URL
     382                                        $format_output .= sprintf( '[embed]%s[/embed]', $meta['media'] );
    394383                                }
    395                         }
     384                        } 
    396385                        break;
    397386                default:
    398387                        return $content;
  • wp-includes/script-loader.php

    diff --git wp-includes/script-loader.php wp-includes/script-loader.php
    index b3bc26f..1b07594 100644
    function wp_default_scripts( &$scripts ) { 
    277277
    278278        $scripts->add( 'imgareaselect', "/wp-includes/js/imgareaselect/jquery.imgareaselect$suffix.js", array('jquery'), '0.9.8', 1 );
    279279
     280        $scripts->add( 'mediaelement', "/wp-includes/js/mediaelement/mediaelement-and-player$suffix.js", array('jquery'), '2.10.1', 1 );
     281        $scripts->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement.js", array('mediaelement'), false, 1 );
     282
    280283        $scripts->add( 'password-strength-meter', "/wp-admin/js/password-strength-meter$suffix.js", array('jquery'), false, 1 );
    281284        did_action( 'init' ) && $scripts->localize( 'password-strength-meter', 'pwsL10n', array(
    282285                'empty' => __('Strength indicator'),
    function wp_default_styles( &$styles ) { 
    543546        $styles->add( 'media-views', "/wp-includes/css/media-views$suffix.css", array( 'buttons' ) );
    544547        $styles->add( 'buttons', "/wp-includes/css/buttons$suffix.css" );
    545548
     549        $styles->add( 'mediaelement', "/wp-includes/js/mediaelement/mediaelementplayer$suffix.css" );
     550        $styles->add( 'wp-mediaelement', "/wp-includes/js/mediaelement/wp-mediaelement.css", array( 'mediaelement' ) );
     551
    546552        foreach ( $rtl_styles as $rtl_style ) {
    547553                $styles->add_data( $rtl_style, 'rtl', true );
    548554                if ( $suffix && ! in_array( $rtl_style, $no_suffix ) )
  • wp-includes/shortcodes.php

    diff --git wp-includes/shortcodes.php wp-includes/shortcodes.php
    index 2dfc277..5389ed2 100644
    function remove_all_shortcodes() { 
    128128}
    129129
    130130/**
     131 * Whether a registered shortcode exists named $tag
     132 *
     133 * @since 3.6.0
     134 *
     135 * @global array $shortcode_tags
     136 * @param string $tag
     137 * @return boolean
     138 */
     139function shortcode_exists( $tag ) {
     140        global $shortcode_tags;
     141        return array_key_exists( $tag, $shortcode_tags );
     142}
     143
     144/**
     145 * Whether the passed content contains the specified shortcode
     146 *
     147 * @since 3.6.0
     148 *
     149 * @global array $shortcode_tags
     150 * @param string $tag
     151 * @return boolean
     152 */
     153function has_shortcode( $content, $tag ) {
     154        if ( shortcode_exists( $tag ) ) {
     155                $matches = array();
     156                preg_match_all( '/' . get_shortcode_regex() . '/s', $content, $matches, PREG_SET_ORDER );
     157                if ( empty( $matches ) )
     158                        return false;
     159
     160                foreach ( $matches as $shortcode ) {
     161                        if ( $tag === $shortcode[2] )
     162                                return true;
     163                }
     164        }
     165        return false;
     166}
     167
     168/**
    131169 * Search content for shortcodes and filter shortcodes through their hooks.
    132170 *
    133171 * If there are no shortcode tags defined, then the content will be returned