WordPress at Your Fingertips
function is not described

WP_Importer::get_page() public WP 1.0

GET URL

{} It's a method of the class: WP_Importer{}

No Hooks.

Return

Array.

Usage

$WP_Importer = new WP_Importer();
$WP_Importer->get_page( $url, $username, $password, $head );
$url(string) (required)
-
$username(string)
-
Default: ''
$password(string)
-
Default: ''
$head *(true false)*

Default: false

Code of WP_Importer::get_page() WP 5.8.2

public function get_page( $url, $username = '', $password = '', $head = false ) {
	// Increase the timeout.
	add_filter( 'http_request_timeout', array( $this, 'bump_request_timeout' ) );

	$headers = array();
	$args    = array();
	if ( true === $head ) {
		$args['method'] = 'HEAD';
	}
	if ( ! empty( $username ) && ! empty( $password ) ) {
		$headers['Authorization'] = 'Basic ' . base64_encode( "$username:$password" );
	}

	$args['headers'] = $headers;

	return wp_safe_remote_request( $url, $args );
}