Skip to content

Commit

Permalink
Local: ensure template assets use the correct port locally
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed Sep 29, 2024
1 parent 7711bf5 commit 286e155
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plugins/jquery-filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,16 @@
}
unset( $sites, $options, $option );

// Ensure that the local port is used for template assets, if it exists.
add_filter( 'theme_root_uri', function( $value ) {
if ( JQUERY_STAGING === 'local' ) {
// Don't specify http vs https here, as the site may be accessed via either.
$siteurl = '//' . strtr( JQUERY_STAGING_FORMAT, [ '%s' => JQUERY_LIVE_SITE ] );
$value = $siteurl . '/wp-content/themes';
}
return $value;
});

// Remove misc links from <head> on non-blog sites
if ( !get_option( 'jquery_is_blog' ) ) {
remove_action( 'wp_head', 'feed_links', 2 );
Expand Down

0 comments on commit 286e155

Please sign in to comment.