PluginProbe
Gutenberg / 14.8.0
Gutenberg v14.8.0
24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 12.6.0 All 403 releases
gutenberg / lib / experimental / html / class-wp-html-attribute-token.php

class-wp-html-attribute-token.php in Gutenberg 14.8.0, at lib/experimental/html/class-wp-html-attribute-token.php

90 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * HTML Tag Processor: Attribute token structure class.
4 *
5 * @package WordPress
6 * @subpackage HTML
7 * @since 6.2.0
8 */
9
10 /**
11 * Data structure for the attribute token that allows to drastically improve performance.
12 *
13 * This class is for internal usage of the WP_HTML_Tag_Processor class.
14 *
15 * @access private
16 * @since 6.2.0
17 *
18 * @see WP_HTML_Tag_Processor
19 */
20 class WP_HTML_Attribute_Token {
21 /**
22 * Attribute name.
23 *
24 * @since 6.2.0
25 * @var string
26 */
27 public $name;
28
29 /**
30 * Attribute value.
31 *
32 * @since 6.2.0
33 * @var int
34 */
35 public $value_starts_at;
36
37 /**
38 * How many bytes the value occupies in the input HTML.
39 *
40 * @since 6.2.0
41 * @var int
42 */
43 public $value_length;
44
45 /**
46 * The string offset where the attribute name starts.
47 *
48 * @since 6.2.0
49 * @var int
50 */
51 public $start;
52
53 /**
54 * The string offset after the attribute value or its name.
55 *
56 * @since 6.2.0
57 * @var int
58 */
59 public $end;
60
61 /**
62 * Whether the attribute is a boolean attribute with value `true`.
63 *
64 * @since 6.2.0
65 * @var bool
66 */
67 public $is_true;
68
69 /**
70 * Constructor.
71 *
72 * @since 6.2.0
73 *
74 * @param string $name Attribute name.
75 * @param int $value_start Attribute value.
76 * @param int $value_length Number of bytes attribute value spans.
77 * @param int $start The string offset where the attribute name starts.
78 * @param int $end The string offset after the attribute value or its name.
79 * @param bool $is_true Whether the attribute is a boolean attribute with true value.
80 */
81 public function __construct( $name, $value_start, $value_length, $start, $end, $is_true ) {
82 $this->name = $name;
83 $this->value_starts_at = $value_start;
84 $this->value_length = $value_length;
85 $this->start = $start;
86 $this->end = $end;
87 $this->is_true = $is_true;
88 }
89 }
90