SimplePie::sort_items()
Sorting callback for items
Method of the class: SimplePie{}
Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.
No Hooks.
Return
true|false
.
Usage
$result = SimplePie::sort_items( $a, $b );
SimplePie::sort_items() SimplePie::sort items code WP 6.5.2
public static function sort_items($a, $b) { $a_date = $a->get_date('U'); $b_date = $b->get_date('U'); if ($a_date && $b_date) { return $a_date > $b_date ? -1 : 1; } // Sort items without dates to the top. if ($a_date) { return 1; } if ($b_date) { return -1; } return 0; }