There are probably a zillion Google results on how to add CORS headers to WordPress, but it’s not something I have ever dealt with. If that’s undoable for whatever reason, you could always add a layer of indirection and create a middleware proxy that delivers the proper headers and repackages the response from the problematic endpoint.
yes there lots of ways. plugins, actions, hooks but I am concerned if this is secure. I will check this… I was thinking to implement it in /quikbooze-client.php same as the others. curl to the rest api and display it same as the other responses.
But hey thank you. You have been very helpful.
Adding this in functions php worked. I think its fine since Methods: GET’
<?php function my_customize_rest_cors() { remove_filter( 'rest_pre_serve_request', 'rest_send_cors_headers' ); add_filter( 'rest_pre_serve_request', function( $value ) { header( 'Access-Control-Allow-Origin: *' ); header( 'Access-Control-Allow-Methods: GET' ); header( 'Access-Control-Allow-Credentials: true' ); header( 'Access-Control-Expose-Headers: Link', false ); return $value; } ); } add_action( 'rest_api_init', 'my_customize_rest_cors', 15 );