Author

Matt Watson

Browsing

In this article I take the Select2 component that I previously added to my Gutenberg plugin, and make it dynamic by taking advantage of the WordPress REST API. This code borrows heavily from the Secure Blocks for Gutenberg plugin. Updated for WordPress 5I’ve updated this example to take into consideration the changes to the registerStore API that came with WordPress 5. In this example we will be making the ‘Select Roles’ Inspector use dynamic data from…

Secure your content in the WordPress Gutenberg editor via login or by user role, with Secure Blocks for Gutenberg. Available for download now in the WordPress plugin repository. Using Secure Blocks you can add any Gutenberg block inside a secure block, and have it render only to logged in users, or you can lock it down to a specific user role (or roles) of your choosing. Secure Blocks also provides an additional area that displays…

For a project I was working on I wanted to use Select2 as a Gutenberg InpectorControl to allow me apply settings to a block. Select2 is a super handy replacement for select boxes on your website. In particular it has some great options for selecting multiple items. The finished product, Select2 in the WordPress Gutenberg InspectorControls The good news is that I didn’t need to build a React component to get Select2 into Gutenberg, the react-select component…

My wife owned a broken old Acer Ultrabook running Windows 10 (originally running Windows 7). It was a lovely little thing when it was new with some great specs, but as the years went by it became unusable. So I took it upon myself to ‘fix it’. And by ‘fix it’ I mean turn it into a Chromebook! Not only did it slow down (as all Windows machines tend to do), but the power management…

You may have noticed that the code examples I use on this site (which runs on WordPress) use a default <code> block, but the code is presented with different colours due to code block syntax highlighting. On my site I use the new (at the time of writing this) WordPress 5 ‘Gutenberg’ editor, which has a nice ‘code block’ feature, allowing you to drop in a code block and start writing code, without all that mucking…

A question I sometimes get asked is can you dynamically set the name of a variable in PHP. For example someone may have a loop, and they want the variables in that loop to have unique names. The answer is, yes this can be done! I’ll tell you how, but I’ll also tell you that there is a much better way to do this. You can of course use a double dollar: $$custom_variable or you…

Hackathons (or Hack Days) are a great way to engage with technical people in your community (not to mention one or two business folks and entrepreneurs), they are also a huge amount of fun! Over the 9th and 10th of March I attended the 24 hour hackathon Hack the DMC at Barnsley Digital Media Centre, with an aim of solving problems faced by multi-occupancy business centres. What happened? There were some fantastic really useful things being worked on.…

This blog post could easily be titled: How I Stopped Worrying and Learned to Curb my Notification Anxiety, or, How to Effectively Work Remotely. I work at the web development agency Make Do. Why is this important? Well Make Do is a remote agency, meaning that all of its employees work remotely either from home, from a digital workspace, from a cafe, a pub or even in the middle of a field if they so choose.…

There are lots and lots of social media channels out there, and people use each of them in different ways. If you tried to post to all the social networks without automating everything, you wouldn’t have time left in the day to do much else. Social media automation is bad. I’ve been guilty of it in the past, but the truth is, most of my close friends and family don’t care about the web events…

Sometimes when writing a block of text using the WordPress editor, you need it to look a certain way, we usually do this by adding styles to peices of text, but we don’t always want our clients to have to open up the text editor and do this manually. In this example we will create a small filter that you can add to your functions.php file to give the user some extra formatting options, to…