WP_MS_Themes_List_Table::_order_callbackpublicWP 1.0

Compares the order of two themes by a specific field.

Method of the class: WP_MS_Themes_List_Table{}

No Hooks.

Returns

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

Usage

$WP_MS_Themes_List_Table = new WP_MS_Themes_List_Table();
$WP_MS_Themes_List_Table->_order_callback( $theme_a, $theme_b );
$theme_a(WP_Theme) (required)
The first theme to compare.
$theme_b(WP_Theme) (required)
The second theme to compare.

Notes

  • Global. String. $orderby The column to order the themes list by.
  • Global. String. $order The order of the themes list (ASC or DESC).

WP_MS_Themes_List_Table::_order_callback() code WP 7.0

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;
}