4

I have updated my wordpress version from 4.6.1 to 4.7.0, but after updating i am getting this error message, when i add or edit any product in woocommerce:

Notice: _usort_terms_by_ID is deprecated since version 4.7.0! Use wp_list_sort instead. in /wp-includes/functions.php on line 3783

But after searching whole files there is no function like that, so how i can fix this issue..

5
  • did you try searching inside the all themes and plugin folder ?
    – GKS
    Commented Dec 7, 2016 at 5:36
  • @GovindKumar yes i have tried to search but not found this function.
    – fmeaddons
    Commented Dec 7, 2016 at 5:37
  • it is inside the woocommerce github.com/woocommerce/woocommerce/blob/master/includes/…
    – GKS
    Commented Dec 7, 2016 at 5:52
  • @GovindKumar Thanks, found that and after replace by wp_list_sort it works perfect.
    – fmeaddons
    Commented Dec 7, 2016 at 5:55
  • I posted a workaround here in #12525 for WP 4.7+ and older versions, that has just been patched.
    – birgire
    Commented Dec 7, 2016 at 10:26

1 Answer 1

7

The function wp_list_sort() has been introduced in WordPress 4.7. It wasn't available before. That's probably why your plugin isn't using it.

The function _usort_terms_by_ID() is still working, and it is actually much faster than wp_list_sort(). Which makes it hard to understand why it has been deprecated. But in your own code keep in mind that functions starting with an undercore (_) are meant to be private in WordPress. You should not use them in your code, at least not directly.

The real issue here is that you can see notices. These are informal, they should be visible for you only, not for your visitors. If that site is public, make sure you turn the debug mode off in your wp-config.php.

WooCommerce has a fix already; you will get that with the next update, so just keep your site up to date, and you are fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.