When scripting a task using the GitHub CLI, I found I needed the Pull Request (PR) number for my current branch (technically my current commit). I was able to use “gh pr view” to get the information.
Solution
unregisterFormatType() for Specific Block Type in Gutenberg
The WordPress block editor (a.k.a. Gutenberg) allows formatting in RichText fields via the Formatting Toolbar API](. Each type of formatting (e.g. Bold and Italic) is a “formatType”. Here we’ll look at removing one of these formatTypes from a specific block type (e.g. removing Bold from the core paragraph block).
Whirlpool Top Loader Washing Machine Broken Latch
Our Whirlpool top loading washing machine (model WTW8127LW) refused to run with the message “Close the lid” (even though the lid was closed). Upon closer inspection, we found the latch (a.k.a. the strike) had broken.
WP CLI Get Current Theme
I thought retrieving the currently active theme on a WordPress website with WP CLI would involve the “wp theme” command but I was wrong. The correct command to get the currently active theme is “wp option get current_theme”.
Why is my file ignored by Git?
Why is my file ignored by Git? Somewhere something is telling Git to ignore your file… but where? Is it in a .gitignore file in your current directory, is it in a .gitignore file in a parent directory, or is it in your global Git ignore file? There are many places it could be. The good news is we can ask Git why it is ignoring the file.
WP CLI Find in Post
Sometimes I want a list of blog posts that contain a certain string. For example, I might want a list of all blog posts that contain the word “kazoo” using WP CLI. My favorite tool for this is “wp post list”.
GitHub Bypass Failed Status Check
Sometimes a GitHub status check fails and you want to override it so you can still merge your PR.
PHP class_exists() check without the Fully Qualified Class Name
Sometimes you need to write PHP code that includes a check that the class you want to use exists. Because you need to provide the fully qualified class name (the namespace and the classname) our code can end up looking a little messy – but there is a better way.
Loop Through WordPress Multisite Blogs with WP CLI
When working on a WordPress multisite with WP CLI, it can be helpful to loop through all of the individual sites.
Replace Local Git Branch with Branch on GitHub
There are times when I want to dispose of my local branch and replace it with the version on GitHub (the upstream version). For example, when I’m reviewing a teammate’s pull request and they rewrite history (e.g. perform a rebase or amend a commit), I don’t have any work on that branch and I only want their updated version.