wp_remote_post

Definition:
function wp_remote_post($url, $args = array() {}

Retrieve the raw response from the HTTP request using the POST method.

Parameters

  • string $url: Site URL to retrieve.
  • array $args: Optional. Override the defaults.

Return values

returns:The response or WP_Error on failure.

Source code

function wp_remote_post($url, $args = array()) {

	$objFetchSite = _wp_http_get_object();

	return $objFetchSite->post($url, $args);

}

4039

wp_remote_head

Definition:
function wp_remote_head($url, $args = array() {}

Retrieve the raw response from the HTTP request using the HEAD method.

Parameters

  • string $url: Site URL to retrieve.
  • array $args: Optional. Override the defaults.

Return values

returns:The response or WP_Error on failure.

Source code

function wp_remote_head($url, $args = array()) {

	$objFetchSite = _wp_http_get_object();

	return $objFetchSite->head($url, $args);

}

4037

wp_remote_get

Definition:
function wp_remote_get($url, $args = array() {}

Retrieve the raw response from the HTTP request using the GET method.

Parameters

  • string $url: Site URL to retrieve.
  • array $args: Optional. Override the defaults.

Return values

returns:The response or WP_Error on failure.

Source code

function wp_remote_get($url, $args = array()) {

	$objFetchSite = _wp_http_get_object();

	return $objFetchSite->get($url, $args);

}

4035

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

wp_rel_nofollow_callback

Definition:
function wp_rel_nofollow_callback( $matches ) {}

Callback to used to add rel=nofollow string to HTML A element.
Will remove already existing rel="nofollow" and rel=’nofollow’ from the string to prevent from invalidating (X)HTML.

Parameters

  • array $matches: Single Match

Return values

returns:HTML A Element with rel nofollow.

Source code

function wp_rel_nofollow_callback( $matches ) {

	$text = $matches[1];

	$text = str_replace(array(' rel="nofollow"', " rel='nofollow'"), '', $text);

	return "<a $text rel=\"nofollow\">";

}

4031