Recently I needed to write a WordPress plugin. Having written a handful of plugins previously this time around I wanted to build something that; I'

Modern WordPress Plugin Development

submited by
Style Pass
2024-10-27 15:30:04

Recently I needed to write a WordPress plugin. Having written a handful of plugins previously this time around I wanted to build something that;

I'm not going to go into too much details of the inner workings of the plugin but concentrate on the elements that make for the more modern approach I was aiming for. This article assumes some understanding of PHP, Composer and WordPress plugin development.

I'm always learning especially when it comes to writing modern and clean PHP so I'm sure there are improvements that could be made. Having said that, I do feel that this plugin is some of my best work to date - though I've still got a long way to go. Yes I'm sure there are better solutions out there for getting something like this up and running but I wanted to challenge myself to see if I could roll out my own solution.

The plugin needs to regularly pull event data from an API and store this using WP Transients. Based on the API data an administrator can then create posts (via a custom post type) which displays the events post type on the front end. There are two shortcodes for showing upcoming events and specific events. Additionally event dates are appended to the content.

Leave a Comment