• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (deprecated)
You are here: Home / Archives for Solution

Solution

Get GitHub PR Number from Current Branch

Last updated on June 3, 2025 by Sal Ferrarello

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.

Filed Under: Computing, Dev Tips, Solution Tagged With: bash script, command line, GitHub, GitHub CLI

unregisterFormatType() for Specific Block Type in Gutenberg

Last updated on February 17, 2025 by Sal Ferrarello

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).

Filed Under: Dev Tips, Programming, Solution Tagged With: Gutenberg, WordPress

Whirlpool Top Loader Washing Machine Broken Latch

Last updated on December 17, 2024 by Sal Ferrarello

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.

Filed Under: Solution Tagged With: home repair

WP CLI Get Current Theme

Last updated on October 30, 2024 by Sal Ferrarello

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”.

Filed Under: Computing, Dev Tips, Solution Tagged With: WordPress, WordPress Theme, wp-cli

Why is my file ignored by Git?

Last updated on August 11, 2024 by Sal Ferrarello

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.

Filed Under: Computing, Dev Tips, Solution Tagged With: Git, gitignore

WP CLI Find in Post

Last updated on August 9, 2024 by Sal Ferrarello

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”.

Filed Under: Dev Tips, Solution Tagged With: WordPress, wp-cli

GitHub Bypass Failed Status Check

Last updated on August 6, 2024 by Sal Ferrarello

Sometimes a GitHub status check fails and you want to override it so you can still merge your PR.

Filed Under: Dev Tips, Solution Tagged With: command line, GitHub

PHP class_exists() check without the Fully Qualified Class Name

Last updated on June 28, 2024 by Sal Ferrarello

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.

Filed Under: Dev Tips, Programming, Solution Tagged With: PHP

Loop Through WordPress Multisite Blogs with WP CLI

Last updated on September 3, 2024 by Sal Ferrarello

When working on a WordPress multisite with WP CLI, it can be helpful to loop through all of the individual sites.

Filed Under: Dev Tips, Programming, Solution Tagged With: wp-cli

Replace Local Git Branch with Branch on GitHub

Last updated on March 30, 2024 by Sal Ferrarello

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.

Filed Under: Computing, Dev Tips, Programming, Solution Tagged With: Git, git alias

  • «Previous Page
  • Page 1
  • Page 2
  • Page 3
  • Page 4
  • Interim pages omitted …
  • Page 19
  • Next Page»

Copyright © 2026 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in