Pivot!

Over the years my personal website has been a showcase of my technical skills, an online CV and more recently a collection of articles and tutorials mostly about WordPress. More recently I setup Wholesome Code as a better place to to store those WordPress tutorials, however it never really felt right. This may be because…

Using the WordPress Block Editor (Gutenberg) with the REST API

In my previous article I talked about how to loop through posts and custom post types within Gutenberg. In this post I talk about receiving and using custom data within Gutenberg from WordPress REST API endpoints. In this example we are going to: Create a REST API endpoint Register a Redux like data store using…

WP_Query and the WordPress Block Editor (Gutenberg)

If you are new to writing plugins for the WordPress Block Editor (Gutenberg), you may be a little confused how to do all the things you did regularly, like grabbing posts with WP_Query. You will be very pleased to know that you can pretty much still do everything you used to do with WP_Query by…

Array Chunk

Using array chunk (array_chunk) we can easily split an array into a multidimensional array (an array of arrays). The array chunk function could be used to break an array into smaller parts, perhaps to make it easier to process. Basic Example Composition Features and Specific Examples Further Reading Basic Example Assuming we setup an array…

Array Change Key Case

Array Change Key Case (array_change_key_case) is a simple function THAT allows you to make all the keys of your array uppercase or lowercase. Basic Example Composition Features and Specific Examples Further Reading Basic Example If we setup an array with uppercase keys (line 1), we can use the array_change_key_case function to make all of these…