【发布时间】:2013-12-12 07:24:02
【问题描述】:
我制作元框,在此我选择多个选项
$opt_meta_author = get_post_meta($post->ID, 'opt_meta_author', true);
<select name="opt_meta_author" id="opt_meta_author" multiple="multiple">
<?php
$auth_args = array(
'post_type' => 'author',
'orderby' => 'title',
'order' => 'ASC'
);
$authors = new WP_Query($auth_args);
while($authors->have_posts()) :
$authors->the_post();
?>
<option value="<?php echo the_title() ?>">
<?php echo the_title() ?>
</option>
<?php
endwhile;
?>
</select>
当我选择多个选项时,它只保存一个选项,我想保存选定的选项
有什么建议
保存元值
$opt_meta_author = $_POST['opt_meta_author'];
update_post_meta( $post->ID, 'opt_meta_author', $opt_meta_author);
【问题讨论】: