cameronterry / dark-matter

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

Fix for oEmbeds on mapped domains #69

Closed cameronterry closed 3 years ago

cameronterry commented 3 years ago

This PR fixes an issue where oEmbeds are some times not handled properly because the URL is jumping between the admin domain and the primary domain.

The issue is caused by the lateness of hook onto the_content filter, previously set to 50. However, the auto-embed attempts to process the URL on the_content / priority of 8 (Code Reference). In turn, this caused issues with the oEmbed as it would attempt to work with an unmapped domain rather than a mapped one.

cameronterry commented 3 years ago

Holding this issue as there could be problems with: https://github.com/WordPress/WordPress/blob/270f2011f8ec7265c3f4ddce39c77ef5b496ed1c/wp-includes/default-filters.php#L172.

Specifically thinking some dynamic-ish Gutenberg blocks might cause a problem here.