Make WordPress Core

Ticket #24381: 24381.2.patch

File 24381.2.patch, 1.9 KB (added by johnbillion, 11 years ago)
  • wp-includes/class-oembed.php

     
    7878        }
    7979
    8080        /**
    81          * The do-it-all function that takes a URL and attempts to return the HTML.
     81         * Takes a URL and return the corresponding oEmbed provider URL, if there is one.
    8282         *
    8383         * @see WP_oEmbed::discover()
    84          * @see WP_oEmbed::fetch()
    85          * @see WP_oEmbed::data2html()
    8684         *
    87          * @param string $url The URL to the content that should be attempted to be embedded.
    88          * @param array $args Optional arguments. Usually passed from a shortcode.
    89          * @return bool|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
     85         * @param string $url  The URL to the content.
     86         * @param array  $args Optional arguments.
     87         * @return bool|string False on failure, otherwise the oEmbed provider URL.
     88         * @since 3.9.0
    9089         */
    91         function get_html( $url, $args = '' ) {
     90        function get_provider( $url, $args = '' ) {
     91
    9292                $provider = false;
    9393
    9494                if ( !isset($args['discover']) )
     
    112112                if ( !$provider && $args['discover'] )
    113113                        $provider = $this->discover( $url );
    114114
     115                return $provider;
     116        }
     117
     118        /**
     119         * The do-it-all function that takes a URL and attempts to return the HTML.
     120         *
     121         * @see WP_oEmbed::fetch()
     122         * @see WP_oEmbed::data2html()
     123         *
     124         * @param string $url The URL to the content that should be attempted to be embedded.
     125         * @param array $args Optional arguments. Usually passed from a shortcode.
     126         * @return bool|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed.
     127         */
     128        function get_html( $url, $args = '' ) {
     129                $provider = $this->get_provider( $url, $args );
     130
    115131                if ( !$provider || false === $data = $this->fetch( $provider, $url, $args ) )
    116132                        return false;
    117133