【发布时间】:2014-11-07 10:54:43
【问题描述】:
我需要编写可以发送电子邮件或短信的简单脚本。我需要获取函数结果并将其分配给某个变量。例如 $message = message();并在发送短信的脚本中获取 $message。
这是我的代码示例:
function message() { $argsvsq = array( 'date_query' => array(
array(
'year' => date( 'Y' ),
'week' => date( 'W' ),
),
),
'author__in' => array($_GET["sendtoid"]),
'post_type' => 'ocinky',
'meta_key' => 'wpcf-date',
'orderby' => 'meta_value',
'order' => 'DESC',
'posts_per_page' => -1
);
$looper = new WP_Query( $argsvsq );
// Start the Loop.
while ( $looper->have_posts() ) : $looper->the_post(); $urok = types_render_field("urok", array("output"=>"HTML")); echo $urok; endwhile;
}
这是我需要显示结果的行
$text_sms = iconv('windows-1251', 'utf-8', message() );
请帮助正确获取函数 message() 的结果...非常感谢!
【问题讨论】:
标签: php wordpress function template-engine