wp_remote_fopen

Definition:
function wp_remote_fopen( $uri ) {}

HTTP request for URI to retrieve content.

Parameters

  • string $uri: URI/URL of web page to retrieve.

Return values

returns:HTTP content. False on failure.

Source code

function wp_remote_fopen( $uri ) {

	$parsed_url = @parse_url( $uri );



	if ( !$parsed_url || !is_array( $parsed_url ) )

		return false;



	$options = array();

	$options['timeout'] = 10;



	$response = wp_remote_get( $uri, $options );



	if ( is_wp_error( $response ) )

		return false;



	return wp_remote_retrieve_body( $response );

}

4033

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: