开发者

Inserting a custom_field in Wordpress using MySql

开发者 https://www.devze.com 2022-12-10 11:15 出处:网络
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:

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");
}
0

精彩评论

暂无评论...
验证码 换一张
取 消