Make WordPress Core

Changeset 25484


Ignore:
Timestamp:
09/18/2013 09:19:20 PM (13 years ago)
Author:
SergeyBiryukov
Message:

Replace non-functional 'wp_audio_shortcode_handler' and 'wp_video_shortcode_handler' filters with 'wp_audio_shortcode_override' and 'wp_video_shortcode_override'.

props ericlewis, SergeyBiryukov.
fixes #25313.

File:
1 edited

Legend:

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

    r25444 r25484  
    883883        $instances++;
    884884
     885        /**
     886         * Override the default audio shortcode.
     887         *
     888         * @since 3.7.0
     889         *
     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.
     893         */
     894        $html = apply_filters( 'wp_audio_shortcode_override', null, $attr, $instances );
     895        if ( null !== $html )
     896                return $html;
     897
    885898        $audio = null;
    886899
    … …  
    976989        return apply_filters( 'wp_audio_shortcode', $html, $atts, $audio, $post_id, $library );
    977990}
    978 add_shortcode( 'audio', apply_filters( 'wp_audio_shortcode_handler', 'wp_audio_shortcode' ) );
     991add_shortcode( 'audio', 'wp_audio_shortcode' );
    979992
    980993/**
    … …  
    10051018        static $instances = 0;
    10061019        $instances++;
     1020
     1021        /**
     1022         * Override the default video shortcode.
     1023         *
     1024         * @since 3.7.0
     1025         *
     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         */
     1030        $html = apply_filters( 'wp_video_shortcode_override', null, $attr, $instances );
     1031        if ( null !== $html )
     1032                return $html;
    10071033
    10081034        $video = null;
    … …  
    11201146        return apply_filters( 'wp_video_shortcode', $html, $atts, $video, $post_id, $library );
    11211147}
    1122 add_shortcode( 'video', apply_filters( 'wp_video_shortcode_handler', 'wp_video_shortcode' ) );
     1148add_shortcode( 'video', 'wp_video_shortcode' );
    11231149
    11241150/**
Note: See TracChangeset for help on using the changeset viewer.