WP_MS_Themes_List_Table::_order_callback
Compares the order of two themes by a specific field.
Метод класса: WP_MS_Themes_List_Table{}
Хуков нет.
Возвращает
int. 0 if equal, -1 if the first is less than the second, 1 if more.
Использование
$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) (обязательный)
- The first theme to compare.
- $theme_b(WP_Theme) (обязательный)
- The second theme to compare.
Заметки
- Global. Строка.
$orderbyThe column to order the themes list by. - Global. Строка.
$orderThe order of the themes list (ASC or DESC).
Код WP_MS_Themes_List_Table::_order_callback() WP MS Themes List Table:: order callback 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;
}