Skip to content

Commit

Permalink
fix: Do not replace URLs in generalSettings query
Browse files Browse the repository at this point in the history
So that a query like this:

query GeneralSettings {
  generalSettings {
    title
    description
    url
  }
}

Gives the expected WP URL instead of the frontend
site URL if “Enable Post and Category URL
rewrites” is enabled at Settings → Headless.
  • Loading branch information
nickcernis authored and mindctrl committed Feb 24, 2021
1 parent 3ea1a35 commit edac7c6
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ function wpe_headless_url_replacement( $response ) {
is_object( $response ) &&
property_exists( $response, 'data' ) &&
is_array( $response->data ) &&
wpe_headless_domain_replacement_enabled()
wpe_headless_domain_replacement_enabled() &&
! array_key_exists( 'generalSettings', $response->data )
) {
array_walk_recursive(
$response->data,
Expand Down

0 comments on commit edac7c6

Please sign in to comment.