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_Processor imports
Browse files Browse the repository at this point in the history
  • Loading branch information
ockham committed Feb 23, 2023
1 parent 415c733 commit e4f2c2a
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
2 changes: 1 addition & 1 deletion src/directives/class-wp-directive-processor.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

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

class WP_Directive_Processor extends WP_HTML_Tag_Processor {
public function get_content_inside_bookmarks( $start_bookmark, $end_bookmark ) {
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';
}

0 comments on commit e4f2c2a

Please sign in to comment.