用XML-RPC匿名发布评论道Wordpress上

使用XML-RPC wp API 中的wp.newComment,可以发布匿名的评论到自己的Wordpress.

首先要安装一个插件:http://www.thepicklingjar.com/code/anonymous-xmlrpc-comments/

然后在Wordpress的后台里允许匿名评论

然后在使用wp.newComment的时候,username和password留空,但是comment数组中,author和author_email是必须的.
这篇文章里说的http://wordpress.org/support/topic/304306?replies=1#post-1188046

If you are passing in a valid username & password for the second and third arguments to the wp.newComment XML-RPC method then the login will always succeed (even for anonymous comments) and WP will use the email, URL, name values for that user over the ones submitted as part of the comment.

I suggest leaving the username and password arguments blank when calling wp.newComment. Then then login will fail, but with the right filter in place anonymous comments are still allowed. So the email, URL and name submitted with the comment will be used.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值