Python Wordpress编辑位置

2024-06-25 23:46:18 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用模块python wordpress xmlrpc编辑我的帖子标题。但最后一行出错了。不知道“EditPost”的用法。有人能举例说明吗?

#find allpost 'movie'
  allpost = client.call(posts.GetPosts({'post_type':'movie'}))

 #find post title 'Bumblebee' n change 'Bumblebee 2018'
  for post in allpost:
      if post.title =='Bumblebee':
         post.title = 'Bumblebee 2018'

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

错误:

^{pr2}$

Tags: 模块client编辑titlewordpressfindmoviecall