When dealing with arrays in Javascript, you frequently need to find an element inside the array and take it out or mutate it. This requires iterating over each item of the array with a for loop or an Array method like Array.find(). You may think these Array methods and for loops are interchangeable, but using… Continue reading For loops vs Array methods in Javascript
How to Make a WooCommerce App with React and WPGraphQL
I recently made a simple eCommerce app using React, WPGraphQL, WooGraphQL, and the Ionic Framework. It was a fun learning experience, this is a nice stack to work with. I have worked with WPGraphQL before, but I still have a lot to learn, so in this post I will share what I learned in case… Continue reading How to Make a WooCommerce App with React and WPGraphQL
Typescript Basics for Javascript Developers
“The main benefit of TypeScript is that it can highlight unexpected behavior in your code, lowering the chance of bugs.” – Typescript Documentation Typescript tells your code editor what your code is supposed to look like so that it can warn you of errors as you type. The benefit of this is mostly code hinting… Continue reading Typescript Basics for Javascript Developers
5 Critical Javascript Methods You Need To Know For React
While working with React, Vue, Angular, and other frameworks, I find myself writing lots of normal Javascript while working with arrays. Methods like slice(), shift(), find(), filter(), and map() are all over my React app code, but I’ve never prioritized digging into them. I went way too long copy/pasting someone else’s code from StackOverflow, and… Continue reading 5 Critical Javascript Methods You Need To Know For React
One Liners to Edit Object Arrays in JavaScript
If you have an array of objects, for example Posts from the WordPress REST API (or WP-API), how do you manipulate them? Let’s say we make a GET request to an API endpoint, such as https://apppresser.com/wp-json/wp/v2/posts. We get back an object array, we can oversimplify it like this: If we want to find a certain… Continue reading One Liners to Edit Object Arrays in JavaScript
WordPress Transients vs. Options
Transients and options are both ways to store a value in the WordPress database, but they work differently. A transient is like an option that disappears after a set amount of time. They are used for temporary values, while options usually stick around. tl;dr: Transients expire, options don’t. Use transients for a single value you… Continue reading WordPress Transients vs. Options
Two helpful functions to build better WordPress plugins
When writing a plugin, it’s important to realize one thing about WordPress: Everyone’s WordPress site is a hot mess. I’m joking. Kinda. Seriously though, everybody uses WordPress differently, so you need to account for that. These 2 PHP functions will help you avoid errors in strange WordPress environments: class_exists() and function_exists(). Avoiding Errors With Plugin… Continue reading Two helpful functions to build better WordPress plugins
Dynamic Content with Gatsby and WordPress
Gatsby is a static site generator, but it can also do dynamic content. It’s built on React, so you can use all the dynamic stuff in React along with your static content. This creates what could be the perfect pairing for a lot of websites. Static content for speed, scalability, security, and SEO, with some… Continue reading Dynamic Content with Gatsby and WordPress
Announcing Static Fuse: Gatsby + WordPress
I got really interested in Gatsby recently, and started creating themes and websites with it. I decided to make things official, and started a project called Static Fuse. Static Fuse is a collaboration with Justin Hall to help developers, freelancers, and agencies build Gatsby + WordPress sites. Justin and I have been working on this… Continue reading Announcing Static Fuse: Gatsby + WordPress
Why JAMstack Is So Hot Right Now
A lot of people are talking about JAMstack right now, and for good reason. Many sites been using this stack for years, it’s nothing new. So why is it such a big deal?