Make WordPress Core

Changeset 25485


Ignore:
Timestamp:
09/18/2013 10:05:46 PM (13 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r25484 r25485  
    874874 * @since 3.6.0
    875875 *
    876  * @param array $attr Attributes of the shortcode.
     876 * @param array  $attr    Attributes of the shortcode.
     877 * @param string $content Optional. Shortcode content.
    877878 * @return string HTML content to display audio.
    878879 */
    879 function wp_audio_shortcode( $attr ) {
     880function wp_audio_shortcode( $attr, $content = '' ) {
    880881        $post_id = get_post() ? get_the_ID() : 0;
    881882
     
    888889         * @since 3.7.0
    889890         *
    890          * @param null             Empty variable to be replaced with shortcode markup.
    891          * @param array $attr      Attributes of the shortcode.
    892          * @param int   $instances Unique numeric ID of this audio shortcode instance.
     891         * @param null              Empty variable to be replaced with shortcode markup.
     892         * @param array  $attr      Attributes of the shortcode.
     893         * @param string $content   Shortcode content.
     894         * @param int    $instances Unique numeric ID of this audio shortcode instance.
    893895         */
    894         $html = apply_filters( 'wp_audio_shortcode_override', null, $attr, $instances );
    895         if ( null !== $html )
     896        $html = apply_filters( 'wp_audio_shortcode_override', '', $attr, $content, $instances );
     897        if ( '' !== $html )
    896898                return $html;
    897899
     
    10091011 * @since 3.6.0
    10101012 *
    1011  * @param array $attr Attributes of the shortcode.
     1013 * @param array  $attr    Attributes of the shortcode.
     1014 * @param string $content Optional. Shortcode content.
    10121015 * @return string HTML content to display video.
    10131016 */
    1014 function wp_video_shortcode( $attr ) {
     1017function wp_video_shortcode( $attr, $content = '' ) {
    10151018        global $content_width;
    10161019        $post_id = get_post() ? get_the_ID() : 0;
     
    10241027         * @since 3.7.0
    10251028         *
    1026          * @param null             Empty variable to be replaced with shortcode markup.
    1027          * @param array $attr      Attributes of the shortcode.
    1028          * @param int   $instances Unique numeric ID of this video shortcode instance.
     1029         * @param null              Empty variable to be replaced with shortcode markup.
     1030         * @param array  $attr      Attributes of the shortcode.
     1031         * @param string $content   Shortcode content.
     1032         * @param int    $instances Unique numeric ID of this video shortcode instance.
    10291033         */
    1030         $html = apply_filters( 'wp_video_shortcode_override', null, $attr, $instances );
    1031         if ( null !== $html )
     1034        $html = apply_filters( 'wp_video_shortcode_override', '', $attr, $content, $instances );
     1035        if ( '' !== $html )
    10321036                return $html;
    10331037
Note: See TracChangeset for help on using the changeset viewer.