我想使用Facebook注册工具。
我已经阅读了https://developers.facebook.com/docs/plugins/registration/
我还介绍了一些插件,比如简单的Facebook连接http://wordpress.org/extend/plugins/simple-facebook-connect/ - 然而,我的设置是非常定制的,我不使用常规的Wordpress注册和登录表单(我使用Theme my login plugin进行登录,Gravity forms plugin进行注册),这是简单的Facebook连接的地方(加上Gravity表单,我完全禁用了标准用户注册,这也有助于防止垃圾邮件发送者)。
我想,也许我可以在标题的某个地方放置一个Facebook登录按钮(在这里我有一个TML登录表单),并创建一个注册Facebook页面模板来处理注册,使用Facebook文档中提到的这个按钮:
<fb:login-button registration-url="https://developers.facebook.com/docs/plugins/registration" />
// If the user arrives at your site logged out of Facebook, the button will say Login.
// When the user clicks it, she will be prompted to enter her Facebook username and password.
// If she has not registered for your site, she will be redirected to the URL you specify in the registration-url parameter.
// If she has already registered for your site, the button will fire an onlogin() Javascript event. When this event is fired you should login the user to your site.
在特殊的facebook注册页面中,我会有如下内容:
<fb:registration
fields="name,birthday,gender,location,email"
redirect-uri="https://developers.facebook.com/tools/echo/"
width="530">
</fb:registration>
(这些都是Facebook文档中未涉及的示例)
现在,对于棘手的部分,我如何过滤来自Facebook的JSON输出,并告诉Wordpress获取数据,检查用户是否已经存在,如果没有注册新用户,则执行登录?尤其是如果我没有在Wordpress标准登录/注册页面/表单中使用上述代码?