Notice: _usort_terms_by_ID is deprecated since version 4.7.0! Use wp_list_sort instead

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..

1 Answer
1

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.

Leave a Comment