• Writing a custom endpoint for the WP REST API

    Introduction

    So this was an interesting project. We use a GEL (global experience language) header and footer on nearly all of our core DCC sites. The issue we have come across is being able to maintain these easily.

    WP REST API to the rescue! To make this a reality, I created a small plugin that create some custom endpoints for the, what I call, beacon site – the site where the menu will be pulled from by multiple other sites.

    So I had a few question which led me to my current solution:

    Is there an endpoint I can use already?… Read the rest
  • Creating my first WordPress API

    I recently started a website project to encourage the communities of Devon to be more involved in the services that we deliver in their community. We have four schemes that in principle help communities to help themselves. These schemes include Snow Wardens, Road Warden, Community self help and Parish Path Partnership (P3). We want to get more residents of Devon involved in these schemes.

    One way of doing this is a postcode search of their area and a query returning which schemes are running in the area and how to get involved.

    I started this by bring a number of sources of data together.… Read the rest

  • WordPress REST API – developing a precautionary

    Back over a year ago now the WordPress team at Devon County Council started exploring a RESTful API. In WordPress 4.4 they introduced an embed extension to embed content into other website. This was the start of the API.

    WordPress 4.7 has just landed and now it has a full RESTful API built right into the core. It is now possible to display all your content by using the new endpoint routes, posts, pages, etc. This is really great, we can now do cross website querying for content using the API. This is just the tip of the iceberg of things that the API can be used for.… Read the rest