Compare two WP_HTML_Text_Replacement objects.
Parameters
$aWP_HTML_Text_Replacementrequired- First attribute update.
$bWP_HTML_Text_Replacementrequired- Second attribute update.
Source
private static function sort_start_ascending( WP_HTML_Text_Replacement $a, WP_HTML_Text_Replacement $b ): int {
$by_start = $a->start - $b->start;
if ( 0 !== $by_start ) {
return $by_start;
}
$by_text = isset( $a->text, $b->text ) ? strcmp( $a->text, $b->text ) : 0;
if ( 0 !== $by_text ) {
return $by_text;
}
/*
* This code should be unreachable, because it implies the two replacements
* start at the same location and contain the same text.
*/
return $a->length - $b->length;
}
Changelog
| Version | Description |
|---|---|
| 6.2.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.