feat: Initial WordPress project

This commit is contained in:
2026-03-18 08:06:28 -04:00
commit 22cdda7fbf
40 changed files with 8903 additions and 0 deletions

View File

View File

@@ -0,0 +1,10 @@
<?php
// Disable 'headless' theme updates
add_filter( 'site_transient_update_themes', 'headless_disable_theme_updates' );
function headless_disable_theme_updates( $transient ) {
if ( isset( $transient->response['headless'] ) ) {
unset( $transient->response['headless'] );
}
return $transient;
}

View File

@@ -0,0 +1,20 @@
<?php
// Customize home URL for headless WordPress
add_filter( 'home_url', 'headless_home_url', 10, 4 );
function headless_home_url( $url, $path, $orig_scheme, $blog_id ) {
// Exclude specific patterns from rewriting
$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 );
}
}
// Rewrite URL protocol to match original home scheme
$scheme = wp_parse_url( get_option( 'home' ) )['scheme'] ?? 'https';
return preg_replace( '#^https:#i', "$scheme:", $url );
}