From 22065dfa73075d5182bc4109dd16234ec53f9304 Mon Sep 17 00:00:00 2001 From: Bernie Reiter Date: Mon, 27 Feb 2023 15:45:08 +0100 Subject: [PATCH] Fix `WP_HTML_Tag_Processor` imports (#162) During preparation for the WP 6.2 release, the HTML Tag Processor files inside the Gutenberg plugin were [moved](https://github.com/WordPress/gutenberg/pull/47749) from `lib/experimental/html/` to `lib/compat/wordpress-6.2/html-api/`. This PR updates the import locations accordingly, and sort of "centralizes" them, so we only reference the external dependency in one file (and can potentially later to point to e.g. `lib/compat/wordpress-6.3/html-api/class-gutenberg-html-tag-processor-6-3.php`, which has some features added after the WP 6.2 Feature Freeze, if needed). --- phpunit/directives/attributes/wp-bind.php | 2 +- phpunit/directives/attributes/wp-class.php | 2 +- phpunit/directives/attributes/wp-context.php | 2 +- phpunit/directives/attributes/wp-style.php | 2 +- phpunit/directives/tags/wp-context.php | 2 +- phpunit/directives/wp-process-directives.php | 2 +- src/directives/wp-html.php | 8 ++++++++ wp-directives.php | 2 +- 8 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 src/directives/wp-html.php diff --git a/phpunit/directives/attributes/wp-bind.php b/phpunit/directives/attributes/wp-bind.php index 9cdde9d4..3d9497af 100644 --- a/phpunit/directives/attributes/wp-bind.php +++ b/phpunit/directives/attributes/wp-bind.php @@ -7,7 +7,7 @@ require_once __DIR__ . '/../../../src/directives/class-wp-directive-context.php'; -require_once __DIR__ . '/../../../../gutenberg/lib/experimental/html/wp-html.php'; +require_once __DIR__ . '/../../../src/directives/wp-html.php'; /** * Tests for the wp-bind directive. diff --git a/phpunit/directives/attributes/wp-class.php b/phpunit/directives/attributes/wp-class.php index 2e0b734b..e3ef75c6 100644 --- a/phpunit/directives/attributes/wp-class.php +++ b/phpunit/directives/attributes/wp-class.php @@ -7,7 +7,7 @@ require_once __DIR__ . '/../../../src/directives/class-wp-directive-context.php'; -require_once __DIR__ . '/../../../../gutenberg/lib/experimental/html/wp-html.php'; +require_once __DIR__ . '/../../../src/directives/wp-html.php'; /** * Tests for the wp-class directive. diff --git a/phpunit/directives/attributes/wp-context.php b/phpunit/directives/attributes/wp-context.php index 3868f3bc..5af625e1 100644 --- a/phpunit/directives/attributes/wp-context.php +++ b/phpunit/directives/attributes/wp-context.php @@ -7,7 +7,7 @@ require_once __DIR__ . '/../../../src/directives/class-wp-directive-context.php'; -require_once __DIR__ . '/../../../../gutenberg/lib/experimental/html/wp-html.php'; +require_once __DIR__ . '/../../../src/directives/wp-html.php'; /** * Tests for the wp-context attribute directive. diff --git a/phpunit/directives/attributes/wp-style.php b/phpunit/directives/attributes/wp-style.php index 995e806f..cb47b350 100644 --- a/phpunit/directives/attributes/wp-style.php +++ b/phpunit/directives/attributes/wp-style.php @@ -7,7 +7,7 @@ require_once __DIR__ . '/../../../src/directives/class-wp-directive-context.php'; -require_once __DIR__ . '/../../../../gutenberg/lib/experimental/html/wp-html.php'; +require_once __DIR__ . '/../../../src/directives/wp-html.php'; /** * Tests for the wp-style directive. diff --git a/phpunit/directives/tags/wp-context.php b/phpunit/directives/tags/wp-context.php index 77999672..92a9abe7 100644 --- a/phpunit/directives/tags/wp-context.php +++ b/phpunit/directives/tags/wp-context.php @@ -7,7 +7,7 @@ require_once __DIR__ . '/../../../src/directives/class-wp-directive-context.php'; -require_once __DIR__ . '/../../../../gutenberg/lib/experimental/html/wp-html.php'; +require_once __DIR__ . '/../../../src/directives/wp-html.php'; /** * Tests for the wp-context tag directive. diff --git a/phpunit/directives/wp-process-directives.php b/phpunit/directives/wp-process-directives.php index 27050f2a..695b008c 100644 --- a/phpunit/directives/wp-process-directives.php +++ b/phpunit/directives/wp-process-directives.php @@ -5,7 +5,7 @@ require_once __DIR__ . '/../../src/directives/wp-process-directives.php'; -require_once __DIR__ . '/../../../gutenberg/lib/experimental/html/wp-html.php'; +require_once __DIR__ . '/../../src/directives/wp-html.php'; class Helper_Class { function process_foo_test( $tags, $context ) { diff --git a/src/directives/wp-html.php b/src/directives/wp-html.php new file mode 100644 index 00000000..e714b813 --- /dev/null +++ b/src/directives/wp-html.php @@ -0,0 +1,8 @@ +