Skip to content

Commit 286e155

Browse files
committed
Local: ensure template assets use the correct port locally
1 parent 7711bf5 commit 286e155

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

plugins/jquery-filters.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@
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+
// Don't specify http vs https here, as the site may be accessed via either.
42+
$siteurl = '//' . strtr( JQUERY_STAGING_FORMAT, [ '%s' => JQUERY_LIVE_SITE ] );
43+
$value = $siteurl . '/wp-content/themes';
44+
}
45+
return $value;
46+
});
47+
3848
// Remove misc links from <head> on non-blog sites
3949
if ( !get_option( 'jquery_is_blog' ) ) {
4050
remove_action( 'wp_head', 'feed_links', 2 );

0 commit comments

Comments
 (0)