PluginProbe
Gutenberg / 14.5.2
Gutenberg v14.5.2
24.1.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 All 404 releases
gutenberg / lib / experimental / html / class-wp-html-text-replacement.php

class-wp-html-text-replacement.php in Gutenberg 14.5.2, at lib/experimental/html/class-wp-html-text-replacement.php

60 lines 1.2 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: Text replacement class.
4 *
5 * @package WordPress
6 * @subpackage HTML
7 * @since 6.2.0
8 */
9
10 /**
11 * Data structure used to replace existing content from start to end 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_Text_Replacement {
21 /**
22 * Byte offset into document where replacement span begins.
23 *
24 * @since 6.2.0
25 * @var int
26 */
27 public $start;
28
29 /**
30 * Byte offset into document where replacement span ends.
31 *
32 * @since 6.2.0
33 * @var int
34 */
35 public $end;
36
37 /**
38 * Span of text to insert in document to replace existing content from start to end.
39 *
40 * @since 6.2.0
41 * @var string
42 */
43 public $text;
44
45 /**
46 * Constructor.
47 *
48 * @since 6.2.0
49 *
50 * @param int $start Byte offset into document where replacement span begins.
51 * @param int $end Byte offset into document where replacement span ends.
52 * @param string $text Span of text to insert in document to replace existing content from start to end.
53 */
54 public function __construct( $start, $end, $text ) {
55 $this->start = $start;
56 $this->end = $end;
57 $this->text = $text;
58 }
59 }
60