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

Dev Tips

Code Standards Naming Styles

Last updated on July 5, 2021 by Sal Ferrarello

There are lots of ways to write variable names when programming. This is the list of ones I find myself using.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Programming Tagged With: code standards

How to Add a Non-Breaking Space

Last updated on May 11, 2020 by Sal Ferrarello

A non-breaking space has a unicode value of `U+00A0` (a normal space has a unicode value of `U+0020`). This is how I add this character.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Computing, Dev Tips, Draft, Solution

Add Gutenberg JavaScript Filter

Last updated on May 18, 2020 by Sal Ferrarello

WordPress PHP filters allow you make a value modifiable from outside of your code. With the WordPress Block Editor (a.k.a. Gutenberg), you can now do the same thing in JavaScript.

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

Revert to Old Version of WordPress Core

Last updated on May 20, 2020 by Sal Ferrarello

These are the two ways I have used to rollback WordPress to an earlier version. Using either technique, you should make a backup copy of your files and your database first!

Warning! This is a draft, not a finalized post. See full draft disclosure.

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

Check WP_DEBUG

Last updated on April 19, 2020 by Sal Ferrarello

Recently I was talking to another developer about how to detect ‘WP_DEBUG’ being set on a WordPress installation. Here is the code I use.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Programming, Solution Tagged With: WordPress, WordPress Plugin

Add a Blank line at the Beginning of Command Line Prompt

Last updated on October 26, 2020 by Sal Ferrarello

While there are many ways to customization your command line prompt, one that can help readability is adding a blank line at the beginning of each prompt.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Solution Tagged With: Bash, command line, zsh

WordPress Gutenberg Functional Component useState

Last updated on March 30, 2020 by Sal Ferrarello

When creating a block for the WordPress block editor (a.k.a. Gutenberg), I find that most of the documentation is for class components. However, with React hooks we can use functional components. When you need to import ‘useState’ from React, you can do it as follows in a WordPress block.

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

Syringe in front of medical vials.

WordPress and SQL Injection

Last updated on February 28, 2020 by Sal Ferrarello

An SQL injection vulnerability occurs when you use a variable in your SQL statement and someone uses the variable to add unexpected code. In this article, we’ll look at how this occurs and how to prevent it.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Programming Tagged With: database, MySQL, WordPress

MySQL Query for Multiple Strings with LIKE

Last updated on April 24, 2020 by Sal Ferrarello

I recently learned that doing a MySQL “LIKE” with multiple strings separated with ‘%’ behaves the same as multiple “LIKE” statements.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Programming Tagged With: MySQL

Test WordPress REST API Endpoints from the Browser with jQuery

Last updated on February 24, 2020 by Sal Ferrarello

You can make WordPress REST API calls from the browser console. Here is one way I work with WordPress REST API endpoints in the browser using jQuery.

Warning! This is a draft, not a finalized post. See full draft disclosure.

Filed Under: Dev Tips, Draft, Programming Tagged With: JavaScript, REST API, WordPress

  • «Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 5
  • Go to page 6
  • Go to page 7
  • Go to page 8
  • Go to page 9
  • Interim pages omitted …
  • Go to page 20
  • Next Page»

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