WooCommerce get_weight 挂钩
WooCommerce get_weight hook
WooCommerce get_weight() 是否有任何钩子,如下所示。似乎在那里 - 但它不起作用
// define the <get_hook_prefix>weight callback
function filter_get_hook_prefix_weight( $this_weight, $instance ) {
$this_weight = 10;
return $this_weight;
}
// add the filter
add_filter( "woocommerce_data_get_weight", 'filter_get_hook_prefix_weight', 10, 2 );
// define the <get_hook_prefix>weight callback
function filter_get_hook_prefix_weight( $this_weight, $instance ) {
$this_weight = 10;
return $this_weight;
}
// add the filter
add_filter( "woocommerce_product_get_weight", 'filter_get_hook_prefix_weight', 10, 2 );
试试这个
WooCommerce get_weight() 是否有任何钩子,如下所示。似乎在那里 - 但它不起作用
// define the <get_hook_prefix>weight callback
function filter_get_hook_prefix_weight( $this_weight, $instance ) {
$this_weight = 10;
return $this_weight;
}
// add the filter
add_filter( "woocommerce_data_get_weight", 'filter_get_hook_prefix_weight', 10, 2 );
// define the <get_hook_prefix>weight callback
function filter_get_hook_prefix_weight( $this_weight, $instance ) {
$this_weight = 10;
return $this_weight;
}
// add the filter
add_filter( "woocommerce_product_get_weight", 'filter_get_hook_prefix_weight', 10, 2 );
试试这个