I recently learned that doing a MySQL “LIKE” with multiple strings separated with ‘%’ behaves the same as multiple “LIKE” statements.
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.
The behaviors of “require”, “include”, “require_once”, and “include_once” in PHP are all very similar with some slight differences. Here is the table highlighting the different behaviors of these statements.
You can quickly create a WordPress child theme by creating a new theme directory and adding two files: style.css and functions.php.
What does declare(strict_types=1); do in PHP? PHP is a weakly typed language, which means that when a value is of the wrong type, PHP tries to cast it to the proper type. For example if you try to add an integer and a string, echo 5 + “3”; PHP will try to cast the string […]
By default phpcs does NOT display the relevant name of the sniff when a sniff fails. By adding the ‘-s’ argument, the sniff names will be displayed. See the following from ‘phpcs –help’. Alternatively, this can be added to your PHP CodeSniffer XML Ruleset.
When setting up a new site using PHPUnit 8.x and PHP 7.2, I got the error message: setUp() must be compatible with PHPUnit\Framework\TestCase::setUp Because we can now define the method as returning no value (with :void) and this is part of the method definition starting in PHPUnit 8.0.0, we need to add this in our […]
When using the WordPress plugin [The Events Calendar](https://theeventscalendar.com/) by Modern Tribe the default link in the calendar will point to the Event page. However, sometimes we want to point this link to the Event Website value (which we can set when creating the event). This is the code I use to do this.
A great place to get started with web coding is CSS. CSS tells the web browser how to display the information on the page, for example the color, size, or font to use. WordPress makes it particularly easy to add your own CSS to your website.