我使用YITH WooCommerce比较插件,我会把包含与我的问题相关的代码的文件:
https://file.io/StHr7KBJBdxF
$current_cat变量已设置为等于:public$current_cat=array()$this->current_cat已被用于代码的某些部分,如何在文件外和函数文件中调用$this->current_cat?
class YITH_Woocompare_Frontend_Premium extends YITH_Woocompare_Frontend {
…
/**
* The list of current cat inside the comparison table
*
* @since 1.0.0
* @var array
*/
public $current_cat = array();
例如:使用了$this->products_list;,如果我想在文件外和函数文件中调用它,它是这样的:$products_list=isset($_COOKIE[get_COOKIE_name()])?json_decode(wp_unslash($_COOKIE[get_COOKIE_name()]):数组();
我希望你能理解我的意思。如果这是一个初学者的问题,请不要diss,因为不是每个人都像你一样专业。此外,我花了很多时间来解决这个问题。我并不是想在这里快速提问以快速找到答案。
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号