admin管理员组文章数量:1297024
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..
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..
Share Improve this question edited Dec 12, 2016 at 12:29 fuxia♦ 107k38 gold badges255 silver badges459 bronze badges asked Dec 7, 2016 at 5:31 fmeaddonsfmeaddons 3961 silver badge10 bronze badges 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/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
Reset to default 7The 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.
本文标签: plugin developmentNotice usorttermsbyID is deprecated since version 470 Use wplistsort instead
版权声明:本文标题:plugin development - Notice: _usort_terms_by_ID is deprecated since version 4.7.0! Use wp_list_sort instead 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741648941a2390356.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论