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>
Also fixes PluginBootTest to be order-independent (reset booted flag)
and to expect ShortcodeDmr hook that boot() now wires.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements alt_get_field(): applies wpmc_alt_get_field_post_id filter for
post_id remapping, guards against missing ACF, runs do_shortcode on string
results, passes arrays/null through unchanged. 4 new tests; full suite
22 tests / 58 assertions green.
Note: Brain Monkey FunctionStub::__construct calls function_exists()
internally; expect() calls must precede when('function_exists')->alias()
in each test to avoid the alias intercepting the stub-creation check and
causing eval redeclaration errors.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>