fix: remove the block theme's title tag, not the classic one

The duplicate <title> survived the last release. Block themes swap
_wp_render_title_tag for _block_template_render_title_tag, so removing
the classic callback matched nothing and both titles kept rendering.

locate_block_template() registers the replacement during template_include,
after `wp` and template_redirect, so wp_head at priority 0 is the earliest
point where it can be removed before it runs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
chrnxandClaude Opus 5 committed 2026-08-14 08:55:31 -05:00
1 parent f9191a18bc
commit e394b88ee6
23 files changed
+33 -25

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/featured-stories",
"version": "0.4.0",
"version": "0.4.1",
"title": "Featured Stories",
"category": "theme",
"description": "A sticky-led selection of topic-diverse stories.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/footer-content",
"version": "0.4.0",
"version": "0.4.1",
"title": "CHRNX Footer Content",
"category": "theme",
"description": "Display translated internal footer navigation and site credit.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/header-tools",
"version": "0.4.0",
"version": "0.4.1",
"title": "CHRNX Header Tools",
"category": "theme",
"description": "Display translated primary navigation and progressive site search.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/journal-link",
"version": "0.4.0",
"version": "0.4.1",
"title": "Journal Link",
"category": "theme",
"description": "Display a translated portable link to the full Journal.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/journal-stream",
"version": "0.4.0",
"version": "0.4.1",
"title": "Journal Stream",
"category": "theme",
"description": "The filterable chronological journal.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/latest-podcast",
"version": "0.4.0",
"version": "0.4.1",
"title": "Latest Podcast",
"category": "theme",
"description": "A linked card for the latest podcast episode.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/mobile-menu-toggle",
"version": "0.4.0",
"version": "0.4.1",
"title": "CHRNX Mobile Menu Toggle",
"category": "theme",
"description": "Progressively reveal the primary navigation on small screens.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/podcast-meta",
"version": "0.4.0",
"version": "0.4.1",
"title": "Podcast Metadata",
"category": "theme",
"description": "Safe episode details for the current post.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/reading-time",
"version": "0.4.0",
"version": "0.4.1",
"title": "Reading Time",
"category": "theme",
"description": "Display a localized estimate based on the current post content.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/related-posts",
"version": "0.4.0",
"version": "0.4.1",
"title": "Related Posts",
"category": "theme",
"description": "Related stories selected by topic, tags, and recency.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/release-detail",
"version": "0.4.0",
"version": "0.4.1",
"title": "Release Detail",
"category": "theme",
"description": "Album cover, listening links, and the ordered tracklist.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/release-list",
"version": "0.4.0",
"version": "0.4.1",
"title": "Release List",
"category": "theme",
"description": "The No Names releases, each linking to its album page.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/selected-work",
"version": "0.4.0",
"version": "0.4.1",
"title": "Selected Work",
"category": "theme",
"description": "Hand-picked projects first, then the most recent ones.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/show-links",
"version": "0.4.0",
"version": "0.4.1",
"title": "Show Links",
"category": "theme",
"description": "Where a podcast show can be listened to, rendered only when a URL exists.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/site-brand",
"version": "0.4.0",
"version": "0.4.1",
"title": "CHRNX Site Brand",
"category": "theme",
"description": "Display the local CHRNX wordmark linked to the site home.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/subscribe-cta",
"version": "0.4.0",
"version": "0.4.1",
"title": "Subscribe CTA",
"category": "theme",
"description": "A call to action linked to the configured subscribe page.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/subscribe-form",
"version": "0.4.0",
"version": "0.4.1",
"title": "Subscribe Form",
"category": "theme",
"description": "The email subscription form, rendered only when a provider endpoint is configured.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/theme-toggle",
"version": "0.4.0",
"version": "0.4.1",
"title": "Theme Toggle",
"category": "theme",
"description": "Choose a light, dark, or system color theme.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/topic-hero",
"version": "0.4.0",
"version": "0.4.1",
"title": "Topic Hero",
"category": "theme",
"description": "A fixed-art hero for an editorial topic.",
+1 -1
View File
@@ -2,7 +2,7 @@
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 3,
"name": "chrnx/track-meta",
"version": "0.4.0",
"version": "0.4.1",
"title": "Track Meta",
"category": "theme",
"description": "Player, listening links, and album for one song.",
+1 -1
View File
@@ -1,5 +1,5 @@
<?php
define( 'CHRNX_VERSION', '0.4.0' );
define( 'CHRNX_VERSION', '0.4.1' );
// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
foreach ( array( 'setup', 'assets', 'taxonomies', 'editor', 'podcast-meta', 'project-meta', 'release-meta', 'show-meta', 'track-meta', 'settings', 'queries', 'media', 'blocks', 'theme-preference' ) as $module ) {
+11 -3
View File
@@ -98,11 +98,19 @@ function chrnx_has_seo_plugin(): bool {
/**
* Drop core's title tag when an SEO plugin prints its own.
*
* Both were rendering, so every page shipped two <title> elements.
* Both were rendering, so every page shipped two <title> elements. Block
* themes swap _wp_render_title_tag for the block-template renderer, so
* removing only the classic one silently did nothing here.
*
* locate_block_template() registers that renderer during template_include,
* after both `wp` and template_redirect, so wp_head is the first hook where
* it exists and can still be removed before it runs.
*/
function chrnx_remove_duplicate_title_tag() {
if ( chrnx_has_seo_plugin() ) {
remove_action( 'wp_head', '_wp_render_title_tag', 1 );
if ( ! chrnx_has_seo_plugin() ) {
return;
}
remove_action( 'wp_head', '_block_template_render_title_tag', 1 );
remove_action( 'wp_head', '_wp_render_title_tag', 1 );
}
add_action( 'wp_head', 'chrnx_remove_duplicate_title_tag', 0 );
+1 -1
View File
@@ -3,6 +3,6 @@ Theme Name: CHRNX
Description: A native block theme for chrnx.dev.
Requires at least: 6.9
Requires PHP: 8.1
Version: 0.4.0
Version: 0.4.1
Text Domain: chrnx
*/