Author: Mr Joshers

  • A Quick Explanation of PHP Ternary Operators.

    A Quick Explanation of PHP Ternary Operators.

    Ternary operators in PHP are shorthand conditional statements that allow you to write a simple if-else statement in a single line of code. The syntax for a ternary operator is: If the condition is true, the true_value is returned. Otherwise, the false_value is returned. For example, the following code: will output “less than or equal…

  • Understanding Vue.js Components and Props: A Practical Example

    Understanding Vue.js Components and Props: A Practical Example

    In the world of web development, Vue.js has rapidly gained popularity as a progressive JavaScript framework for building interactive and dynamic user interfaces. With its simplicity and versatility, Vue.js has become a developer favorite. To illustrate how Vue.js works and how components and props function, let’s dissect a simple Vue.js code snippet. Example Code In…

  • Why is Mac Better for Web Dev?

    Why is Mac Better for Web Dev?

    An objective case for why some web and WordPress developers prefer using Macintosh (Mac) computers for their work

  • Turn a string into an array in PHP

    Turn a string into an array in PHP

    Ah, PHP and string manipulations, good ol’ stuff! To turn a comma-separated string into an array in PHP, you can use the explode() function. This function splits a string by a string separator (in our case, a comma) and returns an array. Here’s a quick example: This will output: And just like that, you’ve got…

  • Remove Global Install of PHPCS

    Remove Global Install of PHPCS

    If you want to wipe the slate clean and remove all global installs of PHPCS and WordPress standards, you can follow these steps: For PHPCS (PHP CodeSniffer): For WordPress Coding Standards: Look for a line mentioning installed_paths. Replace /path/to/wpcs with the actual path you found. These commands should remove the global installations of both PHPCS…

  • PHPCS set up for just one specific WordPress project

    PHPCS set up for just one specific WordPress project

    Let’s get PHPCS set up for just one specific WordPress project. You can do this using Composer, which is a great way to manage dependencies on a per-project basis. This installs PHPCS in the project’s vendor directory. This should show WordPress among the available coding standards. By following these steps, PHPCS and the WordPress Coding…

  • Install PHP 8.2 on Mac with homebrew

    Install PHP 8.2 on Mac with homebrew

    Installing PHP 8.2 on your Mac using Homebrew is pretty straightforward. As a WordPress developer, you’ll probably find this handy for your local development environment. Here’s a step-by-step guide: You should see information about PHP 8.2, indicating that the installation was successful. If you run into any issues, Homebrew’s error messages are usually pretty informative,…

  • Scope Resolution Operator ::

    Scope Resolution Operator ::

    The scope resolution operator, also known as the double colon (::), is a token that allows access to static, constant, and overridden properties or methods of a class in PHP. Here’s a bit more detail on how it’s used: 1. Accessing Static Members You can use the scope resolution operator to access static methods and…

  • What is a Canonical URL?

    What is a Canonical URL?

    You’ve probably come across a Canonical URL in web development, especially in the SEO world. Imagine you have the same content accessible through multiple URLs. This can confuse search engines like Google, making them unsure of which URL represents the original content. It’s kind of like having several paths to the same destination. A Canonical…

  • Typical .ajax call in jQuery

    Typical .ajax call in jQuery

    Here’s what each part does: Remember, these are just some of the options available in a jQuery AJAX call. There are many other options and methods available, which can provide more control and flexibility over your AJAX requests. You can find more details in the jQuery AJAX documentation.