WP_MS_Themes_List_Table::_order_callback( WP_Theme $theme_a, WP_Theme $theme_b ): int

In this article

Compares the order of two themes by a specific field.

Parameters

$theme_aWP_Themerequired
The first theme to compare.
$theme_bWP_Themerequired
The second theme to compare.

Return

int 0 if equal, -1 if the first is less than the second, 1 if more.

Source

public function _order_callback( $theme_a, $theme_b ) {
	global $orderby, $order;

	$a = $theme_a[ $orderby ];
	$b = $theme_b[ $orderby ];

	return 'DESC' === $order ?
		$b <=> $a :
		$a <=> $b;
}

User Contributed Notes

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