WP_Plugin_Install_List_Table::order_callback
Method of the class: WP_Plugin_Install_List_Table{}
No Hooks.
Returns
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)
- .
WP_Plugin_Install_List_Table::order_callback() WP Plugin Install List Table::order callback code WP 6.9.1
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;
}
}