Create/edit/delete CPT w/REST
-
I have a WP site, v 5.3.2, and there is a custom post type “Events” that has three custom fields for ‘date_of_event’, ‘event_time, and ‘event_address’, and this cpt also uses the native fields for title, featured image, and the content.
Our company has an internal database that volunteers throughout the state use to create local events, I want to set this up so that we can POST/PUT/DELETE these events to our WP site into the “Events” cpt.
I’ve worked with the WP REST API before but only to create a live search function for a site that queries its own database for results so I’m familiar with the REST API, but I’m a little confused for how to get started with this task at hand of being able to accept data from this other database. I know this database does have the ability to export these events in json format.
I do want to point out that I do not have access to the company database, so I need to provide them with details of what I need and I think they will need to provide me with the different data field key:value pairs in order for me to properly grab the incoming data to process. Once I know how their event json data is formatted, I can then create my php file to accept the necessary key:value pairs?
Will I need just a single endpoint for this CPT where the POST/PUT/DELETE requests will be sent to?
Thanks.
The topic ‘Create/edit/delete CPT w/REST’ is closed to new replies.