-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MERL-1270: Do not rewrite links in the post editor (#1625)
* fix: do not rewrite links in the post editor When Faust’s “Enable Post and Category URL rewrites” is enabled, this has been causing URLs to be rewritten in the editor to contain the front-end URL instead of the WP URL, which causes them to be saved to the database this way. Instead, we want the WP URL saved to the database. * fix: don't rewrite links in `wp-link-ajax` ajax requests * fix: do not rewrite links on permalink generation requests * test: confirm post_link filtering behavior. Confirms links are not rewritten on post-new.php pages when $_POST is empty. Also confirms Ajax requests to generate sample permalinks are not rewritten. These checks prevent the incorrect guid from being written to the database. Confirms `wp-link-ajax` Ajax requests are not rewritten. This is used by the Classic Editor when linking content. chore: update `enable_rewrites` values in tests to be `1` instead of `true`, for consistency. * add changeset * refactor: extract conditional logic to functions
- Loading branch information
Showing
4 changed files
with
93 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@faustwp/wordpress-plugin': patch | ||
--- | ||
|
||
Fixed a bug where links were rewritten to the Faust Front-end Site URL when using the post editor, resulting in those rewritten links being saved to the post content and guid fields when they shouldn't be. These links are now saved with the URL pointing to the WP site, as they should be. They are still rewritten at runtime to link to the Front-end Site URL when appropriate. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters