Changeset 28507
- Timestamp:
- 05/19/2014 05:36:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-oembed.php
r27957 r28507 19 19 */ 20 20 class WP_oEmbed { 21 var$providers = array();21 public $providers = array(); 22 22 23 23 /** … … 26 26 * @uses apply_filters() Filters a list of pre-defined oEmbed providers. 27 27 */ 28 function __construct() {28 public function __construct() { 29 29 $providers = array( 30 30 '#http://(www\.)?youtube\.com/watch.*#i' => array( 'http://www.youtube.com/oembed', true ), … … 78 78 79 79 /** 80 * Make private/protected methods readable for backwards compatibility 81 * 82 * @since 4.0.0 83 * @param string $name 84 * @param array $arguments 85 * @return mixed 86 */ 87 public function __call( $name, $arguments ) { 88 return call_user_func_array( array( $this, $name ), $arguments ); 89 } 90 91 /** 80 92 * The do-it-all function that takes a URL and attempts to return the HTML. 81 93 * … … 88 100 * @return bool|string False on failure, otherwise the UNSANITIZED (and potentially unsafe) HTML that should be used to embed. 89 101 */ 90 function get_html( $url, $args = '' ) {102 public function get_html( $url, $args = '' ) { 91 103 $provider = false; 92 104 … … 133 145 * @return bool|string False on failure, otherwise the oEmbed provider URL. 134 146 */ 135 function discover( $url ) {147 public function discover( $url ) { 136 148 $providers = array(); 137 149 … … 199 211 * @return bool|object False on failure, otherwise the result in the form of an object. 200 212 */ 201 function fetch( $provider, $url, $args = '' ) {213 public function fetch( $provider, $url, $args = '' ) { 202 214 $args = wp_parse_args( $args, wp_embed_defaults() ); 203 215 … … 235 247 * @return bool|object False on failure, otherwise the result in the form of an object. 236 248 */ 237 function _fetch_with_format( $provider_url_with_args, $format ) {249 private function _fetch_with_format( $provider_url_with_args, $format ) { 238 250 $provider_url_with_args = add_query_arg( 'format', $format, $provider_url_with_args ); 239 251 $response = wp_safe_remote_get( $provider_url_with_args ); … … 252 264 * @access private 253 265 */ 254 function _parse_json( $response_body ) {266 private function _parse_json( $response_body ) { 255 267 return ( ( $data = json_decode( trim( $response_body ) ) ) && is_object( $data ) ) ? $data : false; 256 268 } … … 262 274 * @access private 263 275 */ 264 function _parse_xml( $response_body ) {276 private function _parse_xml( $response_body ) { 265 277 if ( ! function_exists( 'libxml_disable_entity_loader' ) ) 266 278 return false; … … 319 331 * @return bool|string False on error, otherwise the HTML needed to embed. 320 332 */ 321 function data2html( $data, $url ) {333 public function data2html( $data, $url ) { 322 334 if ( ! is_object( $data ) || empty( $data->type ) ) 323 335 return false; … … 374 386 * @return string Possibly modified $html 375 387 */ 376 function _strip_newlines( $html, $data, $url ) {388 private function _strip_newlines( $html, $data, $url ) { 377 389 if ( false !== strpos( $html, "\n" ) ) 378 390 $html = str_replace( array( "\r\n", "\n" ), '', $html );
Note: See TracChangeset
for help on using the changeset viewer.