From 2d3b52e9286d7e1d2f0ab4ef5dc9aec30649922d Mon Sep 17 00:00:00 2001 From: Vladimir Bryzgalov Date: Sat, 16 May 2026 22:35:52 +0500 Subject: [PATCH] feat(wpmc S5): Plugin::boot wires TitleFilter + LinkFilter + RestUrlFilter Co-Authored-By: Claude Sonnet 4.6 --- includes/class-plugin.php | 3 +++ tests/PluginBootS5Test.php | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 tests/PluginBootS5Test.php diff --git a/includes/class-plugin.php b/includes/class-plugin.php index 83d3be4..fc82aa2 100644 --- a/includes/class-plugin.php +++ b/includes/class-plugin.php @@ -55,6 +55,9 @@ final class Plugin TermMeta::register(); Redirect::register(); Router::register(); + TitleFilter::register(); + LinkFilter::register(); + RestUrlFilter::register(); } private function dependencies_satisfied(): bool diff --git a/tests/PluginBootS5Test.php b/tests/PluginBootS5Test.php new file mode 100644 index 0000000..5017ea2 --- /dev/null +++ b/tests/PluginBootS5Test.php @@ -0,0 +1,38 @@ +getProperty('booted'); + $prop->setValue($plugin, false); + + $plugin->boot(); + + self::assertSame( + 9999, + has_filter('the_title', 'do_shortcode'), + 'boot() must wire TitleFilter (the_title → do_shortcode @9999)' + ); + self::assertSame( + 9999, + has_filter('home_url', ['WPMultiCity\\LinkFilter', 'filter_home_url']), + 'boot() must wire LinkFilter (home_url @9999)' + ); + self::assertNotFalse( + has_filter('rest_url', ['WPMultiCity\\RestUrlFilter', 'preserve_host']), + 'boot() must wire RestUrlFilter' + ); + } +}