wphooks.info - oembed_fetch_url

oembed_fetch_url

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/class-oembed.php:
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
		/**
		 * Filters the oEmbed URL to be fetched.
		 *
		 * @since 2.9.0
		 * @since 4.9.0 The `dnt` (Do Not Track) query parameter was added to all oEmbed provider URLs.
		 *
		 * @param string $provider URL of the oEmbed provider.
		 * @param string $url      URL of the content to be embedded.
		 * @param array  $args     Optional arguments, usually passed from a shortcode.
		 */
		$provider = apply_filters( 'oembed_fetch_url', $provider, $url, $args );

		foreach ( array( 'json', 'xml' ) as $format ) {
			$result = $this->_fetch_with_format( $provider, $format );
			if ( is_wp_error( $result ) && 'not-implemented' == $result->get_error_code() ) {
				continue;
			}
			return ( $result && ! is_wp_error( $result ) ) ? $result : false;
		}
		return false;