Skip to content

Commit 9b92a00

Browse files
ryanneufeldscottgonzalez
authored andcommitted
All: Strip protocols for CSS/JS URLs
Fixes jquerygh-312 Closes jquerygh-313
1 parent d6b65dd commit 9b92a00

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

mu-plugins/jquery-filters.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,17 @@ function jquery_unfiltered_html_for_term_descriptions() {
101101
$sortedTerms[ $term->name ] = $term;
102102
}
103103
uksort( $sortedTerms, 'strnatcasecmp' );
104-
104+
105105
if ( strtolower( $args[ 'order' ] ) === 'desc' ) {
106106
$sortedTerms = array_reverse( $sortedTerms );
107107
}
108108

109109
return $sortedTerms;
110110
}, 20, 3 );
111+
112+
// Strip protocol from urls making them protocol agnostic.
113+
add_filter( 'theme_root_uri', 'strip_https', 10, 1 );
114+
add_filter( 'clean_url', 'strip_https', 11, 1 );
115+
function strip_https($url) {
116+
return preg_replace( '/^https?:/', '', $url );
117+
}

0 commit comments

Comments
 (0)