wp-content / plugins / yith / closs.yith.php 具有以下代码:
if(!class_exists('YITH_WooCommerce_Question_Answer')){
class YITH_WooCommerce_Question_Answer {
function love(){
echo“kkkk”;
}
}
}
如何在其他页面的类中调用love()函数? 我尝试在 wp-content / themes / xtocky / woocommerce / content-product.php 中编写以下代码:
$som_var = new YITH_WooCommerce_Question_Answer();
$som_var->love();
但没有工作......
然后我尝试了:
YITH_WooCommerce_Question_Answer::love();
它也不起作用。