Commit Graph

25 Commits

Author SHA1 Message Date
Vladimir Bryzgalov 494061e39f feat(wpmc S4): TermMeta registers ACF main_page_alt on taxonomy town
Add acf-stubs.php + TestCase::setUp() require-after-Patchwork pattern so
acf_add_local_field_group is Patchwork-instrumented and re-interceptable
across FieldGroupTest and TermMetaTest in the same PHP process.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 19:33:39 +05:00
Vladimir Bryzgalov b967a3a59f feat(wpmc S4): Helpers::index_town_alt_page_id reads ACF option 2026-05-16 19:22:59 +05:00
Vladimir Bryzgalov d724089b2d feat(wpmc S4): Helpers::page_unic_swap with per-request cache 2026-05-16 19:22:37 +05:00
Vladimir Bryzgalov d122bfacb5 feat(wpmc S4): Helpers::is_routable_path with page_no_rep exclusions 2026-05-16 19:22:01 +05:00
Vladimir Bryzgalov f4184a7777 feat(wpmc S4): Helpers::main_town_slug reads ACF option 2026-05-16 19:21:31 +05:00
Vladimir Bryzgalov 259470ca63 refactor(wpmc S3): get_terms modern signature + REQUEST_URI cleanup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 20:17:08 +05:00
Vladimir Bryzgalov d8b0d01f1c feat(wpmc S3): procedural wpmc_* API + smoke test
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>
2026-05-12 20:11:47 +05:00
Vladimir Bryzgalov 3dbca34234 feat(wpmc S3): Plugin::boot() wires ShortcodeDmr
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 20:10:42 +05:00
Vladimir Bryzgalov 0be1a5a08f feat(wpmc S3): ShortcodeDmr::render resolves text by current town 2026-05-12 20:07:01 +05:00
Vladimir Bryzgalov f68b30b4e6 feat(wpmc S3): ShortcodeDmr scaffold + register init hook 2026-05-12 20:05:50 +05:00
Vladimir Bryzgalov 22099cf1d6 feat(wpmc S3): Helpers::remove_domain_link via parse_url
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 20:04:10 +05:00
Vladimir Bryzgalov 11bd3a06b0 feat(wpmc S3): Helpers::alt_get_field with do_shortcode + filter
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>
2026-05-12 20:02:57 +05:00
Vladimir Bryzgalov f81cefefbe feat(wpmc S3): Helpers::current_town URI-match path
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 19:58:19 +05:00
Vladimir Bryzgalov 58838b0c19 feat(wpmc S3): Helpers::get_term_by_slug with per-request cache
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 19:56:54 +05:00
Vladimir Bryzgalov 176d8e0c0b feat(wpmc S3): Helpers scaffold + reset_cache wiring
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 19:55:09 +05:00
Vladimir Bryzgalov 12a271981a chore(wpmc S2): defensive defines + PostType::SLUG refs + stale comment
Wrap 4 define() calls with defined() || guards to survive double-load.
Replace hardcoded 'shortcode-town' strings in Taxonomy and FieldGroup
with PostType::SLUG. Update Activator comment to reflect S2 reality.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 18:02:14 +05:00
Vladimir Bryzgalov 38bb7dae55 feat(wpmc S2): make Plugin::boot() idempotent
Add private \$booted flag; guard skips all re-registration on subsequent
calls. TDD: RED (3x boot -> expectAdded->once() fails) then GREEN.
Drop deprecated setAccessible() call (no-op since PHP 8.1).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 18:01:43 +05:00
Vladimir Bryzgalov e2399e2360 feat(wpmc S2): Plugin::boot() wires Taxonomy + PostType + FieldGroup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:53:58 +05:00
Vladimir Bryzgalov 519e436337 feat(wpmc S2): register ACF group list_shortcode for shortcode-town
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:47:57 +05:00
Vladimir Bryzgalov 551f107344 feat(wpmc S2): FieldGroup::register() attaches acf/init hook
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:45:51 +05:00
Vladimir Bryzgalov f95d09cc89 feat(wpmc S2): register CPT shortcode-town with required args
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:42:36 +05:00
Vladimir Bryzgalov e0b87dde0c feat(wpmc S2): PostType::register() attaches init hook
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:42:06 +05:00
Vladimir Bryzgalov b06ea9e605 feat(wpmc S2): register taxonomy town with required args
Also stub translation functions in base TestCase so __() calls from
WPMultiCity namespace resolve correctly via Brain Monkey.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:37:29 +05:00
Vladimir Bryzgalov 53a784bbe8 feat(wpmc S2): Taxonomy::register() attaches init hook
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-12 17:36:26 +05:00
Vladimir Bryzgalov fad5a7d03b chore: init wp-multi-city v0.1.0 with S1 skeleton + S2 design spec
S1 skeleton (cp-8ci, already done):
- wp-multi-city.php with header, constants, hooks bootstrap
- includes/class-plugin.php with PSR-4-ish autoloader, ACF dependency guard
- includes/class-activator.php placeholder
- composer.json (PHP 8.0, phpunit dev)
- README.md with roadmap
- uninstall.php placeholder

S2 design (cp-q7g):
- docs/superpowers/specs/2026-05-12-s2-taxonomy-cpt-acf-design.md
2026-05-12 17:21:08 +05:00