WP_Remote_Get Not working


I have a plugin which uses wp_remote_get() and it’s not working on my nginx server so I decided to test this.

I created a file called test.php and inserted:

<?php $response = wp_remote_get( 'http://www.domain.com/mytest.php' );

print $response ['body']; ?>

When I run this file I am getting error:

2017/02/04 16:22:31 [error] 16573#16573: *461100 FastCGI sent in stderr:

 "PHP message: PHP Fatal error:  Uncaught Error: Call to undefined function
 wp_remote_get() in /var/www/html/wp-content/themes/x-child/test.php:1

I cannot tell why this would be undefined function, given that its part of wordpress core?

, , Joanna Mikalai 4 years 2020-05-13T01:10:56-05:00 0 Answers 122 views 0

Leave an answer