python删除以发布wordpress文章

2024-02-26 18:17 python删除以发布wordpress文章已关闭评论

安装python wordpress xmlrpc

pip install python_wordpress_xmlrpc

删除文章

调用删除文章方法DeletePost()

    def delete_post(self, post_id):
        post = self.get_post(post_id)
        if not post:
            print(f'文章不存在:{post_id}')
            return
        # post = WordPressPost()
        post.id = self.wp.call(posts.DeletePost(post.id))
        print(f'\nid={post.id}')
        print(f'已删除发布文章:{post.title}')
        return post.id

你可能感兴趣的文章

来源:每日教程每日一例,深入学习实用技术教程,关注公众号TeachCourse
转载请注明出处: https://teachcourse.cn/3060.html ,谢谢支持!

资源分享

分类:python 标签:,
python库pyQt所有布局及用法示例介绍 python库pyQt所有布局及用法示例
012-wordpress站点在ubuntu服务器使用nginx服务器搭建,如何配置wp-json wp v2 posts接口只可能本地访问 012-wordpress站点在ubuntu服务器
如何使用手机支付给羊城通充值 如何使用手机支付给羊城通充值
浅谈JDK和JRE 浅谈JDK和JRE

评论已关闭!