maxcutler / python-wordpress-xmlrpc

Python library for WordPress XML-RPC integration

Home Page:http://python-wordpress-xmlrpc.rtfd.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to edit value in custom fields?

uyin85 opened this issue · comments

How to edit custom field value?

  1. I search post id.
  2. After found post id, search specific custom field to edit the value.
  3. Execute below code but only title change. Custom field value not change.
    post = WordpressPost() post.title = 'Bumblebee' post.custom_fields = [{'key':'idtmdb', 'value':'1234'}] client.call(posts.EditPost(16, post))

I'm having the same problem right now.

I managed to make it work!

You need to submit the custom field dict including the id.

post = WordpressPost()

post.title = 'Bumblebee'

post.custom_fields = [{'id':'28322', 'key': 'idtmdb', 'value': '1234'}]

client.call(posts.EditPost(16, post))

Thank you!
Need to add custom_fields id in dict.