Web Development

  • use() is one of the more obscure functions from the @wordpress/data package, mainly because it lacks proper documentation and examples illustrating its usage. By “lacking” I mean the official documentation only has a cryptic two-liner definition for it: Extends a registry to inherit functionality provided by a given plugin. A plugin is an object with…

  • Setting up WordPress Coding Standards in VS Code (updated)

    Much has changed since my last article on how to get WPCS up and running in VS Code, the most notable being the release of WPCS 3.0 which makes it easier to register new coding standards; I’ve also recently switched to using the PHP Sniffer & Beautifier VS Code extension which is a nice replacement…

  • I was playing around with the raw React APIs, specifically React.createElement(), when I was going through the EpicReact workshop on React Fundamentals and I stumbled upon an interesting finding. React.createElement(component, props, …children) accepts an object of props as its second argument and subsequent arguments passed will be its children. However, since children is also a…

  • Setting up WordPress Coding Standards in VS Code

    Note: Here’s a more updated and simple guide. Adhering to a certain set of coding standards is important when it comes to writing good quality code. It makes your code easier to maintain and read not only for yourself but other developers as well. WordPress has its own set of coding standards and it is…

  • React 16 introduces a new concept called Error Boundaries which aims to provide proper error handling in the event of an error in a part of the App’s UI. You might have seen something like this: Ideally, when an error occurs during rendering, we would want to catch it and display a fallback UI instead…

  • If you just started using the Basic Auth plugin for authentication, you might come across issues like 401 (unauthorized) that prevents you from making authenticated requests, even though your code and credentials are correct. Here are two possible solutions to that: 1. Tweak .htaccess fileOpen up the .htaccess file and add the following lines: The…

  • Recently, I have been working on this React project that allows users to upload some documents which will be tagged to their profile. My initial thought was to figure out how to use the WP REST API to upload to the Media Library. After that’s done, I would need to save the URL of the…

  • At the Contributor’s Day of WordCamp Singapore 2019, I ran a workshop on how to build a simple CRUD app using the WP REST API. Unfortunately, due to time constraint, I didn’t manage to explain the source code as much as I would like to. So the purpose of this series of posts is to…

  • Back in June, at a local WordPress Meet-up, I gave an introduction on the WP REST API and also ran a little demo. That was my first ever presentation so I was definitely feeling nervous but also excited at the same time! Excited because it’s one of my favorite topics when it comes to WP…

  • When collaborating with other developers using Git, a simple workflow would be something like: 1. Clone entire project into your local machine2. Work on local copy3. Add and commit changes4. Push commits back to remote repo Every time before we start working on our local copy, we would probably want to ensure we have the…