Problem getting wp posts in plugin with wp_remote_get
I did some changes on my code $remoteargs = array( ‘timeout’ => 20, ‘redirection’ => 5, ‘httpversion’ => ‘1.1’, ‘blocking’ => false, ‘headers’ => array(), ‘cookies’ => array(), ‘body’ => array(), ‘sslverify’ => false, ); $response = wp_remote_get( ‘http://localhost/wordpress/wp-json/wp/v2/posts’,$remoteargs); // Exit if error. if ( is_wp_error( $response ) ) { echo $response->get_error_message(); return; } // … Read more