我在这里询问过(使用 MySql 在 Wordpress 中插入帖子)如何使用 mysql 在 wordpress 中插入帖子,但现在我还需要插入一些自定义字段值,例如:如果我有一个名为stack的 custom_field 我该如何插入使用 mysql 的自定义字段的值...
问问题
253 次
1 回答
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");
}
于 2009-11-05T19:53:47.853 回答