@@ 620-626 (lines=7) @@ | ||
617 | */ |
|
618 | ||
619 | // Do CDN replacement if needed. |
|
620 | if ( ! empty( $this->cdn_url ) ) { |
|
621 | $replacement_url = $this->url_replace_cdn( $url ); |
|
622 | // Prepare replacements array. |
|
623 | $replacements[ $url_src_matches[1][ $count ] ] = str_replace( |
|
624 | $original_url, $replacement_url, $url_src_matches[1][ $count ] |
|
625 | ); |
|
626 | } |
|
627 | } |
|
628 | } |
|
629 | ||
@@ 746-752 (lines=7) @@ | ||
743 | * inlining isn't turned on, or if a resource is skipped from |
|
744 | * being inlined for whatever reason above. |
|
745 | */ |
|
746 | if ( ! $inlined && ( ! empty( $this->cdn_url ) || has_filter( 'autoptimize_filter_base_replace_cdn' ) ) ) { |
|
747 | // Just do the "simple" CDN replacement. |
|
748 | $replacement_url = $this->url_replace_cdn( $url ); |
|
749 | $imgreplace[ $url_src_matches[1][ $count ] ] = str_replace( |
|
750 | $original_url, $replacement_url, $url_src_matches[1][ $count ] |
|
751 | ); |
|
752 | } |
|
753 | } |
|
754 | } |
|
755 |