Commit 5dd28bf
SEO: fix custom per-page title ignored when page is set as static homepage (#50845)
* SEO: fix custom per-page title ignored on static front page
When a WordPress page is set as the site's homepage (Settings > General,
"A static page"), `Jetpack_SEO_Titles::get_page_type()` returns
`'front_page'` instead of `'pages'`. The meta-title override check in
`get_custom_title()` only ran for `'pages'` and `'posts'`, so any SEO
title stored in `jetpack_seo_html_title` post meta was silently skipped.
The function then fell through to the site-wide Front Page title format
template; if that template was blank (the common default), the default
WordPress title was returned — not the user-set per-page SEO title.
Fix: extend the meta-title check to also fire for `'front_page'`. When
a per-page custom title exists it is returned immediately; if not, the
site-wide format template (or the default title) is used as before.
Adds a regression test that creates a static front page, sets a custom
SEO title in post meta, leaves the Front Page format blank, and asserts
that `get_custom_title()` returns the per-page title.
Co-authored-by: matticbot <matticbot@users.noreply.github.com>
* Changelog: use valid changelogger type (bugfix)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: haqadn <adnan.haque@automattic.com>
Co-authored-by: matticbot <matticbot@users.noreply.github.com>
Co-authored-by: Adnan Haque <adnan007.id@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/30369396001
Upstream-Ref: Automattic/jetpack@d17a6451 parent bedf5c0 commit 5dd28bf
0 file changed
0 commit comments