Ticket #24381: 24381.2.patch
File 24381.2.patch, 1.9 KB (added by , 11 years ago) |
---|
-
wp-includes/class-oembed.php
78 78 } 79 79 80 80 /** 81 * T he 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. 82 82 * 83 83 * @see WP_oEmbed::discover() 84 * @see WP_oEmbed::fetch()85 * @see WP_oEmbed::data2html()86 84 * 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 90 89 */ 91 function get_html( $url, $args = '' ) { 90 function get_provider( $url, $args = '' ) { 91 92 92 $provider = false; 93 93 94 94 if ( !isset($args['discover']) ) … … 112 112 if ( !$provider && $args['discover'] ) 113 113 $provider = $this->discover( $url ); 114 114 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 115 131 if ( !$provider || false === $data = $this->fetch( $provider, $url, $args ) ) 116 132 return false; 117 133