WordPress versions 4.9 and below allowed you to translate text in your JavaScript by passing JSON objects via wp_localize_script. While this system works great it has some limitations. With the release of WordPress 5.0, support was introduced to allow developers to translate their theme or plugin directly within JavaScript. Translating in JavaScript has some nice benefits: The available tools work great if you are using plain JavaScript and no form of Continuous Delivery (CI/CD) in your … [Read more...]
Category: Tutorials (page 2)
Retrieving Account Access For a Discontinued Email
A relatively common occurrence is for a user on your organization to purchase a plugin license using their personal email address instead of a shared email. This works fine until the user leaves your organization and their email is removed. If you know the password of the plugin account you may log in and change the email address under Account Details. The following process will allow you to regain access to the plugin account as well as change the email address to a shared email. … [Read more...]
Making PHPUnit 7 tests work with PHP8
Update: The WordPress core integration testing library now supports PHPUnit 9 and no longer requires a special PHPUnit 7 library. Our version of PHPUnit 7 has been discontinued and is no longer available. More information may be found here. A few months ago a new major version of PHP was released which brought many code style and functionality enhancements. A very useful update toward making PHP strict typed and running more computational complex programs natively on PHP. If you are … [Read more...]
Adding Custom JavaScript to Your Site
There are times when you need to add a little JavaScript to your WordPress site but don't want to spin up an entire plugin. Maybe you're doing some AB testing or don't want to edit your theme's JavaScript directly. Maybe you're adding some Google Analytics code. If you've ever requested a customization of the accordion functionality in our Advanced Sidebar Menu PRO plugin, you most likely needed to add some custom JavaScript. Whatever your reasons, there are a few methods to accomplish … [Read more...]
Writing a proper commit message
These days every developer is using some form of version control to manage their code bases and contributions from their team. Most predominantly we are using GIT as our version control of choice. No matter what form of version control you are using, the most important part of keeping a usable code history is, "Writing a proper commit message." Why? If you have ever used git log --grep or used an IDE to find commits you know the importance of having a relevant message to locate the … [Read more...]
Adding VAT to WooCommerce Billing Address
It is a common occurrence to receive requests for invoices that include a customer's VAT for use with their country's tax records. While WooCommerce does not ship with support for generating invoices, there are many great plugins which add invoice functionality. Previously, when someone requested a VAT to be added, we simply directed the customer to cram it into the existing address fields - not anymore! As of today, we've added a special field to the billing address for entering a VAT which … [Read more...]