wc_products_array_orderby_date()
Sort by date.
Хуков нет.
Возвращает
int.
Использование
wc_products_array_orderby_date( $a, $b );
- $a(WC_Product) (обязательный)
- First WC_Product object.
- $b(WC_Product) (обязательный)
- Second WC_Product object.
Список изменений
| С версии 3.0.0 | Введена. |
Код wc_products_array_orderby_date() wc products array orderby date WC 10.5.0
function wc_products_array_orderby_date( $a, $b ) {
if ( $a->get_date_created() === $b->get_date_created() ) {
return 0;
}
return ( $a->get_date_created() < $b->get_date_created() ) ? -1 : 1;
}