我正在嘗試調用過濾器中的操作。我想要從動作方法的值,並用它來過濾功能從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