Commit Graph

6 Commits

Author SHA1 Message Date
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 004a8517e4 feat(wpmc S4): Router::route internal page + page_unic swap 2026-05-16 19:59:00 +05:00
Vladimir Bryzgalov 98e16fce7c test(wpmc S4): Router root URL index_town_alt fallback + no-data behaviors 2026-05-16 19:58:21 +05:00
Vladimir Bryzgalov 9af4c2976e feat(wpmc S4): Router::route root URL uses main_page_alt term meta 2026-05-16 19:58:04 +05:00
Vladimir Bryzgalov b218f5588b test(wpmc S4): Router::route skip-condition invariants 2026-05-16 19:57:28 +05:00
Vladimir Bryzgalov d30a039a73 feat(wpmc S4): Router scaffold + query_vars filter for town 2026-05-16 19:57:12 +05:00