Closed cameronterry closed 2 years ago
Noting, this has only been tested with the Gallery Block on Block Editor. Other image related blocks - i.e. Audio, Cover, Video, etc. - need to be tested.
Classic Editor and shortcodes need tested as well. And logic is needed for Feature Image / attachment related APIs such as wp_get_attachment_image_src()
.
Self note: should provide an ability to set a network-wide CDN domains, which are enforced on all sites. This should be achievable through detecting a constant - such as: DM_NETWORK_CDN
- which is an array of domains.
define( 'DM_NETWORK_CDN', [
'cdn1.mappeddomain1.test',
'cdn2.mappeddomain1.test',
'cdn3.mappeddomain1.test',
] );
This PR adds support to the domain mapping for "Media domains". When added, these domains will be used to map items which are supported by the Media Library on a given site. This will include:
This will also include support for customisations that are provided through
upload_mimes
hook (WordPress Developer Reference). A good example of a customisation: websites using the Safe SVG plugin.Testing check list
CLI changes
Convert a secondary domain into a media domain. Useful for when repurposing an old domain for use a CDN for media assets.
Convert a Media domain to a main domain. This is useful in scenarios when a media domain is redundant and to ensure it redirects to the website.
List all domains - of types, "main" and "media".
Changelog
DM_NETWORK_MEDIA
.Performance Check
Both setups are using Twenty Twenty One with object cache enabled and configured, with both containing 842 posts.
Single site installation
Multisite installation on a site with domain mapping configured.