我遇到了一个让我头疼的问题,正如你们看到的图片,这是我在事件中添加选项时的结果。
我在以下位置更新了代码:
wp-content/theme/mytheme/lib/metabox/function.php
$meta_boxes[] = array(
\'id\' => \'event_date_option\',
\'title\' => __( \'Event options\', \'mytheme\' ),
\'pages\' => array( Custom_Posts_Type_Event::POST_TYPE ), // Post type
\'context\' => \'normal\',
\'priority\' => \'high\',
\'show_names\' => true, // Show field names on the left
\'fields\' => array(
array(
\'name\' => __( \'Event type:\', \'mytheme\' ),
\'desc\' => __( \'Choose event type\', \'mytheme\' ),
\'id\' => SHORTNAME . Widget_Event::EVENT_INTERVAL_META_KEY,
\'type\' => \'select\',
\'options\' => array(
array( \'value\'=>"n" , \'name\' => __( \'Normal\', \'mytheme\' ) ),
array( \'value\'=>"c" , \'name\' => __( \'Comunity\', \'mytheme\' ) ),
),
)
它显示在事件日志中,但我不知道在添加新事件或更新事件日志时如何保存。请帮帮我,谢谢!
啊,我用新表将其保存在数据库中,如:ID\\u POST,VALUE
非常感谢。