admin管理员组文章数量:1302417
i added a new field (property_second) to the admin area of the theme. and i want this field value to be the same as the post title. so if the post title changes, let it change here. how can I do it?
array(
'key' => ERE_METABOX_PREFIX. 'property_second',
'value' => $keyword,
'type' => 'CHAR',
'compare' => 'LIKE',
),
i added a new field (property_second) to the admin area of the theme. and i want this field value to be the same as the post title. so if the post title changes, let it change here. how can I do it?
array(
'key' => ERE_METABOX_PREFIX. 'property_second',
'value' => $keyword,
'type' => 'CHAR',
'compare' => 'LIKE',
),
Share
Improve this question
asked Mar 7, 2021 at 20:16
devo-zaradevo-zara
1
1
- 1 Are you asking how to store the post title in a meta field, or how to update that meta field if/when the post title changes? – Pat J Commented Mar 8, 2021 at 1:37
1 Answer
Reset to default 0Hook into the post status transitions and copy the post title to your secondary field. See documentation:
https://codex.wordpress/Post_Status_Transitions#transition_post_status_Hook
本文标签: Move the post title to another field
版权声明:本文标题:Move the post title to another field 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741696802a2393052.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论