Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Commit

Permalink
Fix WP_HTML_Tag_Processor imports (#162)
Browse files Browse the repository at this point in the history
During preparation for the WP 6.2 release, the HTML Tag Processor files inside the Gutenberg plugin were [moved](WordPress/gutenberg#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).
  • Loading branch information
ockham authored Feb 27, 2023
1 parent 77aed62 commit 22065df
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion phpunit/directives/attributes/wp-bind.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion phpunit/directives/attributes/wp-class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion phpunit/directives/attributes/wp-context.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion phpunit/directives/attributes/wp-style.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion phpunit/directives/tags/wp-context.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion phpunit/directives/wp-process-directives.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down
8 changes: 8 additions & 0 deletions src/directives/wp-html.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

if ( ! class_exists( 'WP_HTML_Tag_Processor' ) ) {
require __DIR__ . '/../../../gutenberg/lib/compat/wordpress-6.2/html-api/class-wp-html-attribute-token.php';
require __DIR__ . '/../../../gutenberg/lib/compat/wordpress-6.2/html-api/class-wp-html-span.php';
require __DIR__ . '/../../../gutenberg/lib/compat/wordpress-6.2/html-api/class-wp-html-text-replacement.php';
require __DIR__ . '/../../../gutenberg/lib/compat/wordpress-6.2/html-api/class-wp-html-tag-processor.php';
}
2 changes: 1 addition & 1 deletion wp-directives.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function () {
return;
}

require_once __DIR__ . '/../gutenberg/lib/experimental/html/wp-html.php';
require_once __DIR__ . '/src/directives/wp-html.php';

require_once __DIR__ . '/src/directives/class-wp-directive-context.php';
require_once __DIR__ . '/src/directives/class-wp-directive-store.php';
Expand Down

0 comments on commit 22065df

Please sign in to comment.