Inserting a custom_field in Wordpress using MySql
I have asked here(Inserting a post in Wordpress using MySql) about how to insert a post in wordpres开发者_开发知识库s using mysql, but now I also need to insert some custom fields values, for example: if I have a custom_field called stack how can I insert a value for that custom field using mysql...
Ok I found this here: 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");
}
精彩评论