PHP
6 days ago
LICENSE.md
6 days ago
README.md
6 days ago
class-wp-html-active-formatting-elements.php
6 days ago
class-wp-html-attribute-token.php
6 days ago
class-wp-html-decoder.php
6 days ago
class-wp-html-doctype-info.php
6 days ago
class-wp-html-native-processor-wrapper.php
6 days ago
class-wp-html-native-tag-processor-wrapper.php
6 days ago
class-wp-html-open-elements.php
6 days ago
class-wp-html-processor-state.php
6 days ago
class-wp-html-processor.php
6 days ago
class-wp-html-span.php
6 days ago
class-wp-html-stack-event.php
6 days ago
class-wp-html-tag-processor.php
6 days ago
class-wp-html-text-replacement.php
6 days ago
class-wp-html-token.php
6 days ago
class-wp-html-unsupported-exception.php
6 days ago
class-wp-token-map.php
6 days ago
composer.json
6 days ago
html5-named-character-references.php
6 days ago
class-wp-html-text-replacement.php
65 lines
| 1 | <?php |
| 2 | /** |
| 3 | * HTML API: WP_HTML_Text_Replacement class |
| 4 | * |
| 5 | * @package WordPress |
| 6 | * @subpackage HTML-API |
| 7 | * @since 6.2.0 |
| 8 | */ |
| 9 | |
| 10 | /** |
| 11 | * Core class used by the HTML tag processor as a data structure for replacing |
| 12 | * existing content from start to end, allowing to drastically improve performance. |
| 13 | * |
| 14 | * This class is for internal usage of the WP_HTML_Tag_Processor class. |
| 15 | * |
| 16 | * @access private |
| 17 | * @since 6.2.0 |
| 18 | * @since 6.5.0 Replace `end` with `length` to more closely match `substr()`. |
| 19 | * |
| 20 | * @see WP_HTML_Tag_Processor |
| 21 | */ |
| 22 | class WP_HTML_Text_Replacement { |
| 23 | /** |
| 24 | * Byte offset into document where replacement span begins. |
| 25 | * |
| 26 | * @since 6.2.0 |
| 27 | * |
| 28 | * @var int |
| 29 | */ |
| 30 | public $start; |
| 31 | |
| 32 | /** |
| 33 | * Byte length of span being replaced. |
| 34 | * |
| 35 | * @since 6.5.0 |
| 36 | * |
| 37 | * @var int |
| 38 | */ |
| 39 | public $length; |
| 40 | |
| 41 | /** |
| 42 | * Span of text to insert in document to replace existing content from start to end. |
| 43 | * |
| 44 | * @since 6.2.0 |
| 45 | * |
| 46 | * @var string |
| 47 | */ |
| 48 | public $text; |
| 49 | |
| 50 | /** |
| 51 | * Constructor. |
| 52 | * |
| 53 | * @param int $start Byte offset into document where replacement span begins. |
| 54 | * @param int $length Byte length of span in document being replaced. |
| 55 | * @param string $text Span of text to insert in document to replace existing content from start to end. |
| 56 | * |
| 57 | * @since 6.2.0 |
| 58 | */ |
| 59 | public function __construct( int $start, int $length, string $text ) { |
| 60 | $this->start = $start; |
| 61 | $this->length = $length; |
| 62 | $this->text = $text; |
| 63 | } |
| 64 | } |
| 65 |