WP_HTML_Tag_Processor::sort_start_ascending( WP_HTML_Text_Replacement $a, WP_HTML_Text_Replacement $b ): int

In this article

This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only by core. It is listed here for completeness.

Compare two WP_HTML_Text_Replacement objects.

Parameters

$aWP_HTML_Text_Replacementrequired
First attribute update.
$bWP_HTML_Text_Replacementrequired
Second attribute update.

Return

int Comparison value for string order.

Source

 * might shift the offsets for those endpoints. Loop through each change
 * and accumulate the total shift for each bookmark, then apply that
 * shift after tallying the full delta.
 */
$head_delta = 0;
$tail_delta = 0;

foreach ( $this->lexical_updates as $diff ) {
	$diff_end = $diff->start + $diff->length;

	if ( $bookmark->start < $diff->start && $bookmark_end < $diff->start ) {
		break;
	}

	if ( $bookmark->start >= $diff->start && $bookmark_end < $diff_end ) {
		$this->release_bookmark( $bookmark_name );
		continue 2;

Changelog

VersionDescription
6.2.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.