get_product 现在不是可用的功能?

get_product is now not a usable function?

我正在使用 Woocommerce 2.3.11 并在 PhpStorm8 中工作。 我在 PhpStorm8 中看到 get_product() 被划掉了..

那么新的获取方式是什么?如果我想遵循那里的标准?

如果我没看错,函数被替换为 wc_get_product。

查看 http://docs.woothemes.com/wc-apidocs/function-wc_get_product.html

您必须创建 WC_Product class

的对象
$product = new WC_Product($post->ID);