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 标签:,
WebAssembly在边缘计算中的实战部署指南 WebAssembly在边缘计算中的实战
自定义弹窗 VS AlertDialog分享弹窗 自定义弹窗 VS AlertDialog分
python将浏览器书签内容下载到本地 python将浏览器书签内容下载到本
Android Spinner控件自定义样式分析 Android Spinner控件自定义样式

评论已关闭!