在类中声明动作时,我们使用以下方法:
class the_class{
function __construct(){
add_action( 'the_action', array( $this, 'cb_function' ) );
}
function cb_function(){
}
}
我们试图在类中声明一个remove操作,我们尝试如下:
class the_class{
function __construct(){
remove_action(
当具有类.woocommerce-product-gallery__wrapper的<figure>旁边有另一个类- .test时,尝试执行操作。 这个.test类是由另一个JavaScript驱动的按钮放在那里的,这个按钮可以切换类的进出。因此,此事件需要继续侦听。 if($( ".woocommerce-product-gallery__wrapper" ).hasClass( "test" )){
console.log('Hello');
// I have the 'hidden' class
}; 我觉得
我最近在一个网站上更新了WooCommerce,而我自己并没有这么做。完成此操作后,我在错误日志中看到了以下一行:
woocommerce_get_price is deprecated since version 3.0.0!
Use woocommerce_product_get_price instead.
但是当我谷歌woocommerce_get_price时,除了这个钩子页和这一页,它只是说它是不推荐的之外,我就找不到任何文档了。但是我找不到关于woocommerce_get_price和woocommerce_product_get_price的输入和输出的信息。这感觉就像一个
筛选器钩子woocommerce_sections_shipping无法将节选项卡添加到woocommerce配送设置:
if ( ! class_exists('WC_Shipping_Calculator')){
class WC_Shipping_Calculator{
public function __construct(){
add_filter('woocommerce_get_settings_shipping', array( $this, 'add_settings_tab'