To create encapsulation of code in Vanilla JavaScript is not so easy as it is with programming languages like Java or Python, for example. For this reason and purpose, in JavaScript we can use the Module pattern. Module pattern can also be used as a singleton object where only one instance of the module exists. We can define Module pattern in various ways, but the way I did it here and the most simple way to use and understand will be presented in this article. I will be using ES6 specification of JavaScript and IIFE ( Immediately Invoked Function Expression ) as this is the most uniform way to do it.
Read MoreWhen you define a theme.json file, you can define global settings for your overall look and feel with it, such as color palettes, font sizes or layout options. So you as a WordPress / PHP developer use theme.json file in order to configure all these variables for the whole app. This means you can set default values that apply across your entire site, ensuring a consistent look and feel, for example you can set a base font color for the whole website.
Read MoreLet's analyze the basic structure of basic regular expression patterns in PHP that can be, and are used very frequently as a standalone expression, or in different combinations to validate simple and complex user inputs and in similar situations. We will use the preg_match_all function in this example to return the matched values contained within a $matches array to see what we get for different regex patterns.
Read MoreDownloading themes or plug-ins from some random place on the internet and not the official and reliable sources, or developers, will maybe save you some money but what ends up happening is you can end up installing all sorts of spyware on your web domain, not to mention the code quality that can be poor and potentially harmful for performance. Watch out for crappy themes and plugins and take the time to analyze the market that you are entering to get what you need for your WordPress.
Read More