【发布时间】:2015-12-19 04:16:16
【问题描述】:
我正在尝试在函数中传递参数并在 wordpress 插件中打印输出我无法传递参数这是我的代码
global $postidd;
$postidd=$_REQUEST["postid"];
function getcontent($postidd)
{
// do something with the args
if($postidd)
{
$args12 = array(
'p'=>15,
'post_type' => 'offers',
'orderby' => 'title',
'order' => 'ASC'
);
$the_query12 = new WP_Query( $args12 );
if ( $the_query12->have_posts() ) : while ( $the_query12->have_posts() ) : $the_query12->the_post();
return $postidd;
endwhile;endif;
return $postidd;
}
}
【问题讨论】:
-
你需要多解释一下这个问题。你在哪里调用这个函数?
标签: php wordpress wordpress-theming