summaryrefslogtreecommitdiffstats
path: root/wp-includes/html-api/class-wp-html-text-replacement.php
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 07:57:30 +0000
commitfa9a33d818470a5796f0ff8797f98b510ed8de18 (patch)
treebde6a1eede376f9b5df5898ce812330152984d8e /wp-includes/html-api/class-wp-html-text-replacement.php
parentReleasing progress-linux version 6.4.3+dfsg1-1~progress7.99u1. (diff)
downloadwordpress-fa9a33d818470a5796f0ff8797f98b510ed8de18.tar.xz
wordpress-fa9a33d818470a5796f0ff8797f98b510ed8de18.zip
Merging upstream version 6.5+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--wp-includes/html-api/class-wp-html-text-replacement.php24
1 files changed, 14 insertions, 10 deletions
diff --git a/wp-includes/html-api/class-wp-html-text-replacement.php b/wp-includes/html-api/class-wp-html-text-replacement.php
index 26b7bb2..4b8a6a6 100644
--- a/wp-includes/html-api/class-wp-html-text-replacement.php
+++ b/wp-includes/html-api/class-wp-html-text-replacement.php
@@ -15,6 +15,7 @@
*
* @access private
* @since 6.2.0
+ * @since 6.5.0 Replace `end` with `length` to more closely match `substr()`.
*
* @see WP_HTML_Tag_Processor
*/
@@ -23,22 +24,25 @@ class WP_HTML_Text_Replacement {
* Byte offset into document where replacement span begins.
*
* @since 6.2.0
+ *
* @var int
*/
public $start;
/**
- * Byte offset into document where replacement span ends.
+ * Byte length of span being replaced.
+ *
+ * @since 6.5.0
*
- * @since 6.2.0
* @var int
*/
- public $end;
+ public $length;
/**
* Span of text to insert in document to replace existing content from start to end.
*
* @since 6.2.0
+ *
* @var string
*/
public $text;
@@ -48,13 +52,13 @@ class WP_HTML_Text_Replacement {
*
* @since 6.2.0
*
- * @param int $start Byte offset into document where replacement span begins.
- * @param int $end Byte offset into document where replacement span ends.
- * @param string $text Span of text to insert in document to replace existing content from start to end.
+ * @param int $start Byte offset into document where replacement span begins.
+ * @param int $length Byte length of span in document being replaced.
+ * @param string $text Span of text to insert in document to replace existing content from start to end.
*/
- public function __construct( $start, $end, $text ) {
- $this->start = $start;
- $this->end = $end;
- $this->text = $text;
+ public function __construct( $start, $length, $text ) {
+ $this->start = $start;
+ $this->length = $length;
+ $this->text = $text;
}
}