wc_products_array_orderby_menu_order()
Sort by menu order.
No Hooks.
Return
Int
.
Usage
wc_products_array_orderby_menu_order( $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_menu_order() wc products array orderby menu order code WC 9.6.1
function wc_products_array_orderby_menu_order( $a, $b ) { if ( $a->get_menu_order() === $b->get_menu_order() ) { return 0; } return ( $a->get_menu_order() < $b->get_menu_order() ) ? -1 : 1; }