Automattic/regenerate-thumbnails

Wrong URL being used

Closed this issue · 1 comments

The Site Address is being used to get the Rest API endpoint, however my site has the WordPress different to the Site Address, and so the plugin just 404's all the ajax.

I am using headless WordPress, and my WordPress is on a subdomain, and the site address is set to be the front-end for the site.

e.g. WordPress is on https://wp.example.com/ yet the site address is https://example.com
Regnerate thumbnails JS tries to access the API at https://example.com/wp-json/wp/v2/media?args when that does not exist

My plugin uses core's get_rest_url() to get the REST API URL.. I'm surprised you aren't having other issues when core tries to use the REST API for JavaScript stuff in the admin area.

I suggest you use the rest_url filter to set it to a value that works for you.

See https://core.trac.wordpress.org/browser/tags/4.9.8/src/wp-includes/rest-api.php#L360