4 Commits

Author SHA1 Message Date
Vladimir Bryzgalov 43e3efc5a2 feat(wpmc 1.1.0): Redirect::handle reverse-slug lookup on is_404
Replace old triggering-on-page_new semantics with washanyanya-style:
- template_redirect@1 + is_404() trigger
- get_posts(name=$slug, post_type=page, status=[private,publish])
- match candidate.ID against page_unic[i].page_new
- 301 to /<town>/<orig-canonical-path>/

Closes Gitea issue #1.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 02:22:24 +05:00
Vladimir Bryzgalov 9586810507 feat(wpmc 1.1.0): Redirect hook moves to template_redirect@1
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 02:15:46 +05:00
Vladimir Bryzgalov 82d2345d12 fix(wpmc 1.0.1): guard ACF helpers with did_action('acf/init')
Add private Helpers::acf_ready() that checks did_action('acf/init') > 0,
then guard the five ACF-dependent methods (alt_get_field, index_town_alt_page_id,
main_town_slug, page_unic_swap, is_routable_path) so they return safe defaults
(null/true) before ACF initialises. Fixes the acf_get_value "called too early"
notice triggered when home_url filter fires before acf/init.

Update existing tests in HelpersTest, LinkFilterTest, RedirectTest, RouterTest
to stub did_action => 1 where ACF-ready behaviour is expected. Add four new
guard tests covering before/after acf/init for main_town_slug and is_routable_path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 17:01:19 +05:00
Vladimir Bryzgalov eb84bb8274 feat(wpmc S4): Redirect class 301s on page_unic clone access
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 20:03:04 +05:00