Skip to content

Commit 7d4f602

Browse files
committed
Continuing effort to combat old CDN code because some devs aren't updating their code.
1 parent 083f604 commit 7d4f602

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

redux-core/inc/classes/class-redux-cdn.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,11 @@ private static function cdn( bool $register, string $handle, string $src_cdn, ar
117117

118118
if ( is_wp_error( $cdn_response ) || 200 !== wp_remote_retrieve_response_code( $cdn_response ) ) {
119119
if ( class_exists( 'Redux_Vendor_URL' ) || class_exists( 'Redux_VendorURL' ) ) {
120-
$src = Redux_Vendor_URL::get_url( $handle );
120+
if ( class_exists( 'Redux_Vendor_URL' ) ) {
121+
$src = Redux_Vendor_URL::get_url( $handle );
122+
} else {
123+
$src = Redux_VendorURL::get_url( $handle );
124+
}
121125

122126
if ( $register ) {
123127
self::register( $handle, $src, $deps, $ver, $footer_or_media, $is_script );
@@ -168,7 +172,11 @@ private static function cdn( bool $register, string $handle, string $src_cdn, ar
168172
*/
169173
private static function vendor_plugin( bool $register, string $handle, array $deps, string $ver, $footer_or_media, bool $is_script ) {
170174
if ( class_exists( 'Redux_Vendor_URL' ) || class_exists( 'Redux_VendorURL' ) ) {
171-
$src = Redux_Vendor_URL::get_url( $handle );
175+
if ( class_exists( 'Redux_Vendor_URL' ) ) {
176+
$src = Redux_Vendor_URL::get_url( $handle );
177+
} else {
178+
$src = Redux_VendorURL::get_url( $handle );
179+
}
172180

173181
if ( $register ) {
174182
self::register( $handle, $src, $deps, $ver, $footer_or_media, $is_script );

0 commit comments

Comments
 (0)