我在这里(Inserting a post in Wordpress using MySql)询问如何使用mysql在wordpress中插入帖子,但现在我还需要插入一些自定义字段值,例如:如果我有一个名为堆栈的custom_field 如何使用mysql ...
为该自定义字段插入值答案 0 :(得分:2)
好的我在这里找到了这个:http://www.samburdge.co.uk/wordpress/wp-plugins-and-custom-fields
function add_custom_field($id) {
//Add your value as a custom field with the key 'myKey'
//but only if the form data exists
add_post_meta($id, 'thumb_url', "value");
}