cameronterry / dark-matter

A highly opinionated domain mapping plugin for WordPress Networks
Other
12 stars 2 forks source link

get_rest_url() returns primary domain in admin #27

Closed cameronterry closed 5 years ago

cameronterry commented 6 years ago

The function get_rest_url() is returning the primary mapped domain rather than the admin domain, when utilised on WordPress /wp-admin/ area.

This in turn is affecting window.wpApiSettings which is used by plugins and sending their REST API requests to the primary domain, which in turn causes this error in the browser's console.

Request header field X-WP-Nonce is not allowed by Access-Control-Allow-Headers in preflight response.

Noticed the issue primarily with Yoast SEO and it's dashboard widget. An issue does not appear to be lodged on their issues list by any one yet, but that could change.

But could be a cause of this issue noticed by Redirection plugin as well (although the reporter seems to have a separate issue of a similar nature.

gpirie commented 6 years ago

This also affects regenerate thumbnails.