Writing a custom endpoint for the WP REST API


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

Extending the Devon County Council colour palette

The Devon County Council (DCC) colour palette was first introduced in 2007 as part of the Ourbrand corporate identity rules. These colours have helped us establish a strong and consistent identity across all areas of our work. A palette of eight core house colours and five high-contrast colours for monochrome designs were developed to make printed documents more attractive and easily navigable.

In recent years Council finances have been squeezed; there has been an emphasis on money saving and fewer printed materials have been created – and many people now look for information online.

The development and adoption of Local Government Digital Service Standards has now shifted the focus to delivering good quality, user centred, value for money digital services.… 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

Making things open – using Git

A few weeks ago we got an email from a colleague here, with a problem that needed solving; our ICT people were starting to look at the issue of data storage, and had flagged up things like the Spend Over £500 files – big csv files that we publish every month, going back several years –  as something we needed to look at before they became unmanageable. At the same time we were hearing that the process for adding a new file each month was ridiculously manual, tedious and about as far from agile as you could get. It got even worse when we talked about moving the files somewhere and updating the web pages they’re catalogued on – every link would have to be re-made manually.… Read the rest