fix: headless_home_url needs to be in mu-plugins

This commit is contained in:
2026-01-28 21:07:51 -05:00
parent 3e56ba7eb3
commit 51f594baa5
2 changed files with 20 additions and 15 deletions

View File

@@ -17,21 +17,6 @@ function moonshine_after_setup_theme() {
// Register sidebars
}
// Bypass headless home URL for specific cases
add_filter( 'home_url', 'moonshine_bypass_home_url', 10, 4 );
function moonshine_bypass_home_url( $url, $path, $orig_scheme, $blog_id ) {
$excluded_patterns = array(
'#/wp-json(/|$)#i', // WP REST API
'#\.(xsl|xml)$#i', // Sitemap and XSLT files
);
foreach ( $excluded_patterns as $pattern ) {
if ( preg_match( $pattern, $url ) ) {
return get_site_url( $blog_id, $path, $orig_scheme );
}
}
return $url;
}
// Display theme version in admin footer
add_filter( 'update_footer', 'moonshine_update_footer', 100 );
function moonshine_update_footer() {