我使用了这个插件
http://wordpress.org/extend/plugins/option-tree/
创建一些自定义元盒。
我试图通过使用他们的ID嵌入多个Vimeo视频。以下是我如何将其显示在编辑器上的,可以工作,而且数据保存起来似乎没有问题。
add_action( 'admin_init', 'portfolio_meta_boxes' );
function portfolio_meta_boxes() {
$works_meta_box = array(
'id' => 'works_item',
'title' => 'Portfolio Item',
'desc' => 'Add your portfolio item here.',
'pages' => array( 'bkmworks' ),
'context' => 'normal',
'priority' => 'high',
'fields' => array(
array(
'id' => 'vimeo',
'label' => 'Vimeo videos',
'desc' => '',
'std' => '',
'type' => 'list-item',
'rows' => '',
'post_type' => '',
'taxonomy' => '',
'class' => '',
'settings' => array(
array(
'id' => 'vimeo_id',
'label' => 'Vimeo Video ID',
'desc' => 'Insert your Vimeo video ID. Example: https://vimeo.com/<strong>57747054</strong>. Insert only the numbers in bold.',
'std' => '',
'type' => 'text',
'rows' => '',
'post_type' => '',
'taxonomy' => '',
'class' => ''
)
)
)
)); ot_register_meta_box( $works_meta_box );}
然而,我不明白如何将代谢盒数据显示到列表中。我不懂PHP,任何帮助都将不胜感激。