• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (deprecated)

Get Last Modified Value of a WordPress Post

Last updated on June 19, 2023 by Sal Ferrarello

When reading an article online, I find it helpful to know when the article was last updated. Not all blogs display the last updated value however even when the last updated value is not displayed, the value is accessible via the WordPress REST API. This is how I retrieve the last modified value from the WordPress REST API.

Filed Under: Computing, Dev Tips, Programming, Solution Tagged With: JSON, REST API, web browser, WordPress

Pretty Print JSON URL

Last updated on May 20, 2023 by Sal Ferrarello

I work a lot with JSON endpoints and having a browser extension to pretty print the JSON response is invaluable. However, sometimes I’m using a different machine (or guiding someone on their machine) and rather than asking them to install a browser extension, I use this trick. If the user is on the page displaying the JSON response, running this command in the browser console will pretty print the response await (await fetch(window.location.href)).json().

Filed Under: Dev Tips, Solution Tagged With: JSON, REST API, web browser

Change Render Size of Featured Image in WordPress Gutenberg Block Editor

Last updated on May 7, 2023 by Sal Ferrarello

In the WordPress block editor (a.k.a. Gutenberg) the “Featured Image” is rendered at the WordPress ‘large’ image size by default. By adding a WordPress JavaScript filter to the ‘editor.PostFeaturedImage.imageSize’ hook, we can change this default rendering.

Filed Under: Dev Tips, Programming Tagged With: Gutenberg, JavaScript, WordPress, WordPress Filter

How to Run Code in the Browser Console

Last updated on May 6, 2023 by Sal Ferrarello

As a developer, a trick I often use is running some JavaScript directly in the browser to confirm the behavior.

Filed Under: Computing, Dev Tips, Programming Tagged With: JavaScript, troubleshoot, web browser

Git delete remote branch

Last updated on April 25, 2023 by Sal Ferrarello

This is the command I run when I want to delete a branch named “chore/fix-typo” from the default remote (which is named “origin”): git push origin –delete chore/fix-typo

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

Prevent Dragging an HTML Element

Last updated on March 21, 2023 by Sal Ferrarello

Sometimes users accidentally drag an HTML element into an editable area. This can be prevented by adding draggable=”false” to the element.

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

Git Get Current Branch Name

Last updated on March 18, 2023 by Sal Ferrarello

I find there are two different times I want to get the current branch name: 1. When I’m at the command line, 2. Inside a Git alias function I’m writing. Interestingly, I find that my approach in these two situations are different.

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

phpcs no matches found ignore

Last updated on March 13, 2023 by Sal Ferrarello

When running phpcs with the –ignore option (because I don’t want to scan the /vendor nor /node_modules directories), I kept getting the error “zsh: no matches found: –ignore=/vendor/*,/node_modules/*”.

Filed Under: Computing, Dev Tips, Programming, Solution Tagged With: PHPCS, zsh

Git Branch Naming

Last updated on February 26, 2023 by Sal Ferrarello

There are lots of ways to name Git branches. These are my personal rules I’ve developed for naming Git branches.

Filed Under: Computing, Dev Tips, Recommendations Tagged With: Git

Don’t Do It Now, Open an Issue Instead

Last updated on February 26, 2023 by Sal Ferrarello

When working on an issue, it is easy to get sidetracked by other unrelated changes that need to be made. I’ve found that instead of addressing other issues as I spot them, taking a moment to open an issue and then ignoring them allows me to stay focused on the task at hand.

Filed Under: Dev Tips, Programming, Recommendations, Solution Tagged With: focus, lifehack, motivation

  • «Previous Page
  • Go to page 1
  • Go to page 2
  • Go to page 3
  • Go to page 4
  • Interim pages omitted …
  • Go to page 41
  • Next Page»

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