即时通讯使用这个WordPress Metabox框架:http://www.deluxeblogtips.com/p/meta-box-script-for-wordpress.htmlWordpress metabox:如何获得具有多个值的字段值?
这里是代码
array(
'name' => '<strong>Robots Meta</strong>',
'desc' => '',
'id' => $prefix . 'robot',
'type' => 'radio',
'options' => array(
'if' => 'index, follow',
'in' => 'index, nofollow',
'nf' => 'noindex, follow',
'nn' => 'noindex, nofollow'
),
),
我如何调用每个模板的无线电值的价值?
我想这样做,但它只是检查是否设置与否:
$metas = get_post_meta(get_the_ID(), 'hiro_robot', false);
foreach ($metas as $meta) {
echo $meta;
}
if (in_array($val, $metas)) {
echo "$val is set";
} else {
echo "$val is not set";
}