• Resolved Melly

    (@melissaod)


    Hello. About a year ago, a member of your plugin provided the following code to me:

    function ace_sort_woocommerce_available_shipping_methods( $rates, $package ) {
    uasort( $rates, function($a, $b) {
    return $b->get_cost() < $a->get_cost();
    });
    return $rates;
    }
    add_filter( ‘woocommerce_package_rates’ , ‘ace_sort_woocommerce_available_shipping_methods’, 10, 2 );

    Today when checked debug, there was a warning that said “Deprecated: uasort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in /home/collec26/public_html/wp-content/themes/universal-store/functions.php on line 490

    Can you please tell me how to update this code accordingly?

    Thank you for your time.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Deprecated uasort()’ is closed to new replies.