Skip to content
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

Issue-1157: Root-Relative Image URLs Use Wrong Function for Base URL #1160

Merged

Conversation

renatonascalves
Copy link

@renatonascalves renatonascalves commented Sep 10, 2024

Summary

This pull request addresses an issue where root-relative image URLs were incorrectly processed due to the use of site_url instead of home_url, particularly affecting setups using the Roots Bedrock WordPress boilerplate. This issue led to inline image blocks throwing errors when attempting to push articles to Apple News, as the images attempted to load from URLs prefixed incorrectly with "/wp". Fixes #1157.

Implementation Details

  • Updated the plugin to use home_url instead of site_url for generating full URLs from root-relative paths. This change ensures that the URLs for inline images in articles are correctly formed, avoiding the previously encountered errors.
  • Adjusted the base URL to reflect the value set in the home option field, ensuring compatibility and correctness across different WordPress configurations.

Testing Steps

  1. Deploy a site using the Roots Bedrock WordPress boilerplate.
  2. Post an article containing an inline image block using the WordPress block editor.
  3. Attempt to publish the article to Apple News and confirm that no errors are thrown for the inline images.

Acceptance Criteria

  • Ensure that inline image URLs are correctly formed without the incorrect "/wp" prefix when articles are pushed to Apple News.
  • Verify that the change does not adversely affect the URLs for other content types, such as featured or thumbnail images.
  • Conduct testing with both Roots Bedrock setups and standard WordPress installations to ensure compatibility across different configurations.

@renatonascalves renatonascalves marked this pull request as ready for review September 11, 2024 02:38
Copy link
Member

@kevinfodness kevinfodness left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great - thanks for adding the tests! 🍣

@renatonascalves renatonascalves merged commit 74bb65a into develop Sep 12, 2024
11 checks passed
@renatonascalves renatonascalves deleted the fix/issue-1157/root-relative-image-url-base-function branch September 12, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Root-Relative Image URLs Use Wrong Function for Base URL
2 participants