Page 1 of 1

Getting data from wordpress-site

Posted: Wed May 17, 2017 6:28 pm
by Zood
Hey!

So a couple weeks ago I started on a new project, creating a professional agenda for restaurants to handle their reservations.
So far so good! Now i am getting a request to implement reservations made on their website (all Wordpress-websites).
Any tips on how to handle this?
I have never worked with Wordpress before..

Thanks in advance!
Zood

Re: Getting data from wordpress-site

Posted: Wed May 17, 2017 6:52 pm
by ClipArtGuy
There is an open source Wordpess library Here: https://github.com/digitalpomegranate/l ... wp-restapi
and a webinar about it here: https://youtu.be/D_6b04AltTQ

Re: Getting data from wordpress-site

Posted: Fri May 19, 2017 4:14 pm
by ghettocottage
edit: after re-reading your original post I realized you might mean that there is already a reservation system set up on the website, and they want you to pull data from that to your application you are building.

If that is the case, do you know if they are using a custom-built thing on the site, or is it a plugin? If it is a plugin, what is the name of it?

my original reply is below, but I was thinking along the lines of building something from scratch so people could make reservations on the Wordpress website.

################

It depends on how you want to implement the reservation system. It does not necessarily have to be part of the core Wordpress structure. It is possible to add your own tables to a wordpress database, and pull that data into webpages using something like this (for example):

<?php
global $wpdb;
$customers = $wpdb->get_results("SELECT * FROM customers;");
print_r($customers);
?>

Here is a basic rundown: http://www.makeuseof.com/tag/working-cu ... wordpress/

This approach might work better for you if you already have your data structure built and do not want to re-create it to fit into core Wordpress tables. It also has the advantage of being future-proof against major Wordpress upgrades that might break your app (I had this happen once with a Joomla website and custom application...was quite a pain to have to go back and pick through all the changes)


Having said all that...you can also build with core Wordpress structure. They have a nice API and tons of documentation. I have done some interesting things using Custom Post Types in Wordpress, but I prefer to keep my complex apps separate and just pull any data I need into Wordpress using $wpdb->get_results

Re: Getting data from wordpress-site

Posted: Fri Apr 06, 2018 7:27 am
by JustinW42
ClipArtGuy wrote:
Wed May 17, 2017 6:52 pm
There is an open source Wordpess library Here: https://github.com/digitalpomegranate/l ... wp-restapi
and a webinar about it here: https://youtu.be/D_6b04AltTQ
I downloaded the files from GitHub, but I am unclear on how to use them. I have watched the Webinar and it appears they are opened as a traditional stack, so we can copy the code we need, but I can't seem to open them in LC 9 (Indy or Community editions).

Any quick tips to get started?