简体   繁体   English

WordPress自定义Web服务

[英]Wordpress Custom Webservices

I have to create Web services From WordPress Database.I have to create web-services for mobile devices like user Posts ,Create and Update User Profile ,Login ,Login with social Networks ,Account Details ,Messages etc.In this WordPress tables and Custom tables created by plugins or Admin in WordPress will be affected. 我必须从WordPress数据库创建Web服务。我必须为移动设备创建Web服务,例如用户帖子,创建和更新用户个人资料,登录,使用社交网络登录,帐户详细信息,消息等。在此WordPress表和自定义表中由WordPress中的插件或管理员创建的创建将受到影响。

I want to Know any WordPress API or web services Plugin is there are not which can interact with WordPress Tables and Custom tables created by plugins or Admin. 我想知道任何WordPress API或Web服务插件均不可以与由插件或管理员创建的WordPress表和自定义表进行交互。 Any help would be appreciated. 任何帮助,将不胜感激。

We actually did something quite like this. 实际上,我们做了类似的事情。

To start the whole wordpress-api from a custom file you have to do this: 要从自定义文件启动整个wordpress-api,您必须执行以下操作:

<?php require('/wp-load.php'); ?>

After that is done you can now use all functions in the Wordpress Api. 完成之后,您现在可以使用Wordpress Api中的所有功能。

For example: 例如:

<?php 
function getBlogTitle(){
    $blog_title = get_bloginfo('name');
    echo '{restfulapi:{title: '.$blog_title.'}}';
}
?>

Is just a small example on what you can do. 只是您可以做什么的一个小例子。 But it gives you the full power of wordpress and its installed plugins. 但是它为您提供了wordpress及其安装的插件的全部功能。

Good luck! 祝好运!

Try this Url: 试试这个网址:

http://mikeschinkel.com/blog/restful-web-services-in-wordpress-plugin/ http://mikeschinkel.com/blog/restful-web-services-in-wordpress-plugin/

Full specification is there how to create webservices from WordPress plugin. 完整规范提供了如何从WordPress插件创建Web服务。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM