我已经为收件人创建了一个自定义的帖子类型,并为收件人性别创建了一个额外的字段。我已经在前端创建了一个表单,用于添加带有所有必填字段的收件人。但是当我提交表单时,一个新的帖子添加到收件人中,除了性别字段之外的所有字段。性别字段是单选按钮。以下是附加字段的代码:
array (
'key' => 'field_5426684ccbad6',
'label' => 'Gender',
'name' => 'gender',
'type' => 'radio',
'required' => 1,
'choices' => array (
'male' => 'Male',
'female' => 'Female',
),
'other_choice' => 0,
'save_other_choice' => 0,
'default_value' => '',
'layout' => 'horizontal',
),请告诉我如何从前端更新性别字段?
发布于 2016-03-23 14:03:23
使用update_post_meta而不是add_post_meta
https://stackoverflow.com/questions/36146479
复制相似问题