<?php | |
$user = 'username'; | |
$password = 'password'; | |
$url = 'http://example.com/'; | |
$args = array( | |
'headers' => array( | |
'Authorization' => 'Basic '.base64_encode("$user:$password") | |
) | |
); | |
$result = wp_remote_get($url, $args); |
headers に ‘Authorization: Basic ‘ を渡せば良いです。
ユーザー名、パスワードは : (コロン) で区切って base64_encode() してやればおっけ。