diff options
Diffstat (limited to '')
-rw-r--r-- | wp-includes/html-api/class-wp-html-text-replacement.php | 24 |
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; } } |