| 1 |
<?php |
| 2 |
namespace Activitypub; |
| 3 |
|
| 4 |
/** |
| 5 |
* Allow localhost URLs if WP_DEBUG is true. |
| 6 |
* |
| 7 |
* @param array $r Array of HTTP request args. |
| 8 |
* @param string $url The request URL. |
| 9 |
* |
| 10 |
* @return array Array or string of HTTP request arguments. |
| 11 |
*/ |
| 12 |
function allow_localhost( $r, $url ) { |
| 13 |
$r['reject_unsafe_urls'] = false; |
| 14 |
|
| 15 |
return $r; |
| 16 |
} |
| 17 |
add_filter( 'http_request_args', '\Activitypub\allow_localhost', 10, 2 ); |
| 18 |
|