【php – 如何将附加参数传递给wordpress过滤器?】教程文章相关的互联网学习教程文章

WordPress参数传递及路由规则

1.WordPress参数怎么传递,不使用?xx=xx的方式。 function add_query_vars($aVars) { $aVars[] = "msds_pif_cat"; // represents the name of the product category as shown in the URL return $aVars; }// hook add_query_vars function into query_vars add_filter('query_vars', 'add_query_vars');function add_rewrite_rules($aRules) { $aNewRules = array('msds-pif/([^/]+)/?$' => 'index.php?pagename=msds-pif&msds_pif...

php – 如何将附加参数传递给wordpress过滤器?【代码】

add_filter('wp_list_pages_excludes', 'gr_wp_list_pages_excludes');function gr_wp_list_pages_excludes($exclude_array) { $id_array=$array('22');$exclude_array=array_merge($id_array, $exclude_array);return $exclude_array; }我是wordpress的新手.上面的代码工作正常.但是我需要传递额外的参数,比如$mu_cust_arg到函数gr_wp_list_pages_excludes.如何通过apply_filters或任何其他方法使用它?任何帮助表示赞赏. 提前...