我正在尝试调用过滤器中的操作。我想要从动作方法的值,并用它来过滤功能从wordpress中的add_action中检索值
add_filter('wc_product_table_query_args', 'wcpt_custom_query_args', 10, 3);
function wcpt_custom_query_args($args, $product_table) {
add_action('dokan_store_profile_frame_after', 'add_store_id', 13, 2);
;
// do something with $args
$args += array('author' => $store_id);
return $args;
}
function add_store_id($store_user, $store_info){
$store_id = $store_user->ID;
return $store_id;
}
我怎样才能检索功能wcpt_custom_query_args里面的$ STORE_ID?
全局不工作...我已经尝试过:( – Himani
请先加载add_store_id之后比wcpt_custom_query_args funciton –
非常感谢...通过加载add_store_id函数它工作:) :) :) – Himani