I am trying to pass argument in function and print the output in wordpress plugin i was not able to pass parameter here's my code
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;
}
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire