wc_products_array_orderby_id()
Sort by id.
No Hooks.
Return
Int
.
Usage
wc_products_array_orderby_id( $a, $b );
- $a(WC_Product) (required)
- First WC_Product object.
- $b(WC_Product) (required)
- Second WC_Product object.
Changelog
Since 3.0.0 | Introduced. |
wc_products_array_orderby_id() wc products array orderby id code WC 9.4.2
function wc_products_array_orderby_id( $a, $b ) { if ( $a->get_id() === $b->get_id() ) { return 0; } return ( $a->get_id() < $b->get_id() ) ? -1 : 1; }