wphooks.info - oembed_remote_get_args

oembed_remote_get_args

(trunk - 5.1-alpha-44286)

The hook occurs in the following 2 files

wp-includes/class-oembed.php:
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
		/**
		 * Filters oEmbed remote get arguments.
		 *
		 * @since 4.0.0
		 *
		 * @see WP_Http::request()
		 *
		 * @param array  $args oEmbed remote get arguments.
		 * @param string $url  URL to be inspected.
		 */
		$args = apply_filters( 'oembed_remote_get_args', $args, $url );

		// Fetch URL content
		$request = wp_safe_remote_get( $url, $args );
		if ( $html = wp_remote_retrieve_body( $request ) ) {

			/**
			 * Filters the link types that contain oEmbed provider URLs.
			 *
			 * @since 2.9.0
wp-includes/class-oembed.php:
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
	 * @since 3.0.0
	 *
	 * @param string $provider_url_with_args URL to the provider with full arguments list (url, maxheight, etc.)
	 * @param string $format Format to use
	 * @return false|object|WP_Error False on failure, otherwise the result in the form of an object.
	 */
	private function _fetch_with_format( $provider_url_with_args, $format ) {
		$provider_url_with_args = add_query_arg( 'format', $format, $provider_url_with_args );

		/** This filter is documented in wp-includes/class-oembed.php */
		$args = apply_filters( 'oembed_remote_get_args', array(), $provider_url_with_args );

		$response = wp_safe_remote_get( $provider_url_with_args, $args );
		if ( 501 == wp_remote_retrieve_response_code( $response ) ) {
			return new WP_Error( 'not-implemented' );
		}
		if ( ! $body = wp_remote_retrieve_body( $response ) ) {
			return false;
		}
		$parse_method = "_parse_$format";