WP_MS_Themes_List_Table::_order_callback()publicWP 1.0

Method of the class: WP_MS_Themes_List_Table{}

No Hooks.

Return

Int.

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(array) (required)
-
$theme_b(array) (required)
-

Notes

  • Global. String. $orderby
  • Global. String. $order

WP_MS_Themes_List_Table::_order_callback() code WP 6.4.3

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

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

	if ( $a === $b ) {
		return 0;
	}

	if ( 'DESC' === $order ) {
		return ( $a < $b ) ? 1 : -1;
	} else {
		return ( $a < $b ) ? -1 : 1;
	}
}