Created
June 8, 2021 02:14
-
-
Save labboy0276/24b032421c072774fed003c37c0f0f4b to your computer and use it in GitHub Desktop.
Smush PRO Bedrock patch
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
diff --git a/core/modules/class-cdn.php b/core/modules/class-cdn.php | |
index d86d910..2af3541 100644 | |
--- a/core/modules/class-cdn.php | |
+++ b/core/modules/class-cdn.php | |
@@ -430,7 +430,7 @@ class CDN extends Abstract_Module { | |
$src = apply_filters( 'smush_filter_generate_cdn_url', $src ); | |
// Support for WP installs in subdirectories: remove the site url and leave only the file path. | |
- $path = str_replace( get_site_url(), '', $src ); | |
+ $path = str_replace( WP_HOME, '', $src ); | |
// Parse url to get all parts. | |
$url_parts = wp_parse_url( $path ); | |
@@ -1496,4 +1496,4 @@ class CDN extends Abstract_Module { | |
return getimagesize( $path ); | |
} | |
-} | |
\ No newline at end of file | |
+} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Also add this to your wp-config:
define( 'WPMUDEV_HUB_SITE_URL', 'https://yoursite.com/' );
define( 'WP_SMUSH_API_DOMAIN', 'https://yoursite.com/' );