WordPress at Your Fingertips
function is not described

WP_Plugin_Install_List_Table::order_callback() private WP 1.0

{} It's a method of the class: WP_Plugin_Install_List_Table{}

No Hooks.

Return

Int.

Usage

// private - for code of main (parent) class only
$result = $this->order_callback( $plugin_a, $plugin_b );
$plugin_a(object) (required)
-
$plugin_b(object) (required)
-

Code of WP_Plugin_Install_List_Table::order_callback() WP 5.8.2

private function order_callback( $plugin_a, $plugin_b ) {
	$orderby = $this->orderby;
	if ( ! isset( $plugin_a->$orderby, $plugin_b->$orderby ) ) {
		return 0;
	}

	$a = $plugin_a->$orderby;
	$b = $plugin_b->$orderby;

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

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