Parameters
$plugin_a
objectrequired$plugin_b
objectrequired
Source
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;
}
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.