Skip to content

Commit 1c14a5c

Browse files
committed
Local: ensure template assets use the correct port locally
1 parent 5a19a9c commit 1c14a5c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

plugins/jquery-filters.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@
3535
}
3636
unset( $sites, $options, $option );
3737

38+
// Ensure that the local port is used for template assets, if it exists.
39+
add_filter( 'theme_root_uri', function( $value ) {
40+
if ( JQUERY_STAGING === 'local' ) {
41+
$siteurl = 'http://' . strtr( JQUERY_STAGING_FORMAT, [ '%s' => JQUERY_LIVE_SITE ] );
42+
$value = $siteurl . '/wp-content/themes';
43+
}
44+
return $value;
45+
});
46+
3847
// Remove misc links from <head> on non-blog sites
3948
if ( !get_option( 'jquery_is_blog' ) ) {
4049
remove_action( 'wp_head', 'feed_links', 2 );

0 commit comments

Comments
 (0)