Category: all of the things

  • Playing around with WP, Gatsby and Netlify

    This should be a nice explanation of what I’m doing but it’s not, I just wanted a different post at the top of the home page. 💖✨👍 Repo here https://github.com/tharsheblows/gatsby-test

  • Using Gutenberg blocks in place of custom metaboxes in WordPress

    Custom metaboxes are used extensively in WordPress for layout purposes as well as data structure. However, they don’t necessarily — in fact they rarely — save to the meta key’s array of objects when they’re added to the WordPress REST API and can’t be used by Gutenberg’s built in meta attribute. How can we use Gutenberg with…

  • register_meta(), register_rest_field() and the WP REST API

    There are two standard ways to add additional data into a post’s object in the WP REST API: register_meta() for post meta which is a string, number or boolean and register_rest_field()for everything else. There’s a bit on the difference between the two in the REST API docs. With Gutenberg, register_meta() is being used more widely and there’s…

  • Iterating over an array of objects which I desperately want to be reactive in Vue.js

    [a note to my future self from my current self as of 17 April 2018: are you here again? Is there definitely a unique key on that loop? Are you sure? GO PUT ONE ON NOW. Use the uuid package, it’s easy. Then come back if it still doesn’t work.] This took me a while yesterday…

  • “This block has been modified externally” notice of death in Gutenberg

    This notice drove me insane, especially because I couldn’t quite figure out what was being compared. It turns out it’s that the save function in registerBlockType() compares its return value to whatever is between the block’s html comment tags in the database.

  • The Mandelbrot set visualised in golang

    [note on 07 April 2018: I wrote this in late September 2017 but never published it. I think it’s not finished but useful up until that point so I’m publishing it now] This is a deeper dive into the Mandelbrot exercises in Chapter 3 of The Go Programming Language (Addison-Wesley Professional Computing Series) (that’s an affiliate…

  • New Year’s Resolutions

    Writing them down for posterity.

  • Using Select2 with ajax with CMB2 repeating groups

    No idea if the title makes sense. I wanted a Select2 which uses a remote data source queried via ajax with a CMB2 repeating group so made a plugin to understand it better. It’s pretty heavily commented so I don’t forget why I did what I did. There are definitely a few if not many…

  • Using custom tables with CMB2

    This is more straightforward than I expected (yay thank you @jtsternberg). The short of it is to add a filter to cmb2_override_meta_value or cmb2_override_{$a[‘field_id’]}_meta_value to get the data and cmb2_override_meta_save to save it. But what if I have a repeatable group huh? What then?

  • Bulk deleting users in WordPress multisite

    So I have over 10,000 spam users and need to delete them1. The bulk delete in multisite only does 20 at a time and is somewhat slow so I wanted a better way to delete them all. This could be a massive mistake, if you are reading this because you need the same thing, you…