-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: Fixes issues for content replacement for the site and media URLs #2014
base: canary
Are you sure you want to change the base?
Conversation
… and also updates tests to use WP 6.6 and 6.7 Fixes various issues with using content replacement for the site URL.
🦋 Changeset detectedLatest commit: be14c9a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📦 Next.js Bundle Analysis for @faustwp/getting-started-exampleThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
@josephfusco This is the draft PR for the site URL issues. This fixes the various issues as per our call last week but I also want to update the image srcset replacement with the same functionality so that we replace all HTTP protocols e.g. HTTP, HTTPS or // |
Just noting I am working on also updating the image_source_srcset_replacement function callback aswell to use all HTTP protocols so I will have an updated PR next week after the holidays. |
Awesome! |
Thanks @theodesp I have also now updated the PR with details on how to replicate the issue and test the issue. |
See #1956
This fixes various issues for content replacement callback functions for both the site and media URLs. There is 2 main fixes in this branch.
The branch also adds 2 new filters to allow developers to modify the URLS used for content replacement
faustwp_get_wp_site_urls
- An array of site URLsfaustwp_get_wp_site_media_urls
- An array of media site URLsThis branch also updated Github actions to also use WordPress 6.6. and 6.7
Tasks
Description
See above.
Related Issue(s):
#1956
Testing
Setup
As per issue #1956 I setup a WordPress Multisite (sub-domains) with the latest version of 6.7.1 using Local.
I setup 3 sub-domains and installed FaustWP, WPGraphQL & ACF and one of the sites was setup as
http://alpha.multisite.local/
I setup a field group for pages and I setup a WYSIWG editor field with the field name
summary
I then updated the sample page to have an image for the WYSIWG field and also a link e.g.
I then used the following GraphQL query in the WPGraphQL IDE for debugging and fixing the issues
I then access the site on HTTPS rather than HTTP (site_url)
Tests
Note
http://localhost:3000
is the frontend URL set in Faust WP and I am accessing the site on HTTPS e.g.https://alpha.multisite.local/wp-admin/
Test 1: URL Rewrites Enabled
Query
Output
All 3 URLs (image src, srcset and link) were updated correctly to the frontend URL
http://localhost:3000/
Test 2: URL Rewrites Enabled and Media Rewrites Disabled
Query
Output
The image URL wasn't updated and the link was updated to the frontend URL.
Test 3: URL Rewrites Disabled and Media Rewrites Disabled
Query
Output
Neither the image src, srcset or link was updated to use the frontend URL
Test 4: URL Rewrites Disabled and Media Rewrites Enabled
Query
Output
Both the image src and srcset URLs were updated with the frontend URL where the link stayed the same
Screenshots
Documentation Changes
There was 2 new filters added
faustwp_get_wp_site_urls
for allowing developers to add or modify an array of site URLS used for content replacementfaustwp_get_wp_site_media_urls
for allowign developers to add or modify an array of media site URLS for content replacemntDependant PRs