Changeset 40628 for trunk/src/wp-includes/class-oembed.php
- Timestamp:
- 05/11/2017 06:18:00 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-oembed.php
r40574 r40628 320 320 321 321 /** 322 * Takes a URL and attempts to return the oEmbed data. 323 * 324 * @see WP_oEmbed::fetch() 325 * 326 * @since 4.8.0 327 * @access public 328 * 329 * @param string $url The URL to the content that should be attempted to be embedded. 330 * @param array|string $args Optional. Arguments, usually passed from a shortcode. Default empty. 331 * @return false|object False on failure, otherwise the result in the form of an object. 332 */ 333 public function get_data( $url, $args = '' ) { 334 $args = wp_parse_args( $args ); 335 336 $provider = $this->get_provider( $url, $args ); 337 338 if ( ! $provider ) { 339 return false; 340 } 341 342 $data = $this->fetch( $provider, $url, $args ); 343 344 if ( false === $data ) { 345 return false; 346 } 347 348 return $data; 349 } 350 351 /** 322 352 * The do-it-all function that takes a URL and attempts to return the HTML. 323 353 * … … 333 363 */ 334 364 public function get_html( $url, $args = '' ) { 335 $args = wp_parse_args( $args );336 337 365 /** 338 366 * Filters the oEmbed result before any HTTP requests are made. … … 356 384 } 357 385 358 $ provider = $this->get_provider( $url, $args );359 360 if ( ! $provider || false === $data = $this->fetch( $provider, $url, $args )) {386 $data = $this->get_data( $url, $args ); 387 388 if ( false === $data ) { 361 389 return false; 362 390 }
Note: See TracChangeset
for help on using the changeset viewer.