• Hello Friends
    I HAVE A WORD PRESS SITE and an mobile application whivh is related to the site and all post are shown there.
    to connet sute to mob app, I wrote webswevice and now it is woeking.
    now i am going to make a plugin from connection of this web service and mob app.
    Unfortunately I have no idea for this work …
    Would you please guide me what should I do for writing the plugin, and how I can Implement this idea?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Basic information on creating a plugin is at Writing a Plugin. Still a work in progress, but you can also use the Plugin Handbook.

    As for WP communicating with other Internet resources, it depends on whether WP is requesting or providing data. All communication will be by HTTP requests. To request something, PHP offers several options, including cURL, HTTP functions, or simply file_get_contents(). None of this really relates to WP. That comes in once the response is received, you do something with it.

    If WP is receiving requests, the requests should go through admin-ajax.php or admin-post.php. The POST handler also works with GET requests. Documentation for using admin-post.php is scarce, but it is fairly straight forward. You can probably deduce what to do by just examining the file.

    XML is usually the data exchange format. If you have control of both ends, consider not using XML. XML support in PHP leaves something to be desired. I prefer to use JSON when I can.

Viewing 1 replies (of 1 total)
  • The topic ‘how i can write webservice plugin’ is closed to new replies.