Uses
| Uses | Description |
|---|---|
| wp-includes/http.php: wp_safe_remote_request() | Retrieve the raw response from a safe HTTP request. |
| wp-includes/plugin.php: add_filter() | Hook a function or method to a specific filter action. |
GET URL
(string) (Required)
(string) (Optional)
Default value: ''
(string) (Optional)
Default value: ''
(bool) (Optional)
Default value: false
(array)
File: wp-admin/includes/class-wp-importer.php
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 );
}
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_importer/get_page