| 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 |
|