How Frontenberg Works
How does Frontenberg work? I’m going to walk through what I did to build a frontend Gutenberg site, the problems encountered, and the fixes
How does Frontenberg work? I’m going to walk through what I did to build a frontend Gutenberg site, the problems encountered, and the fixes
A few weeks ago, I wrote an article titled Post Meta Abuse, but I think some have misunderstood the problem at hand. Meta Queries are Bad? Searching for posts via post meta is bad, but grabbing post meta is not. For example, this is a hideously expensive/slow query: $args = array( ‘meta_key’ => ‘color’, ‘meta_value’ […]
I need to write a REST API endpoint, but lets assume we know nothing about REST APIs.
What is the correct way to build a WordPress plugin, the official, recommended way that was always intended? The idealised standard? The Problem Plugins are not discrete modules in the WordPress world. Their isolation exists only on the filesystem, but once that code is loaded into memory it shares the same space as Core itself. […]
Would you like to embed and run some PHP code in a blog post? Need to include a PHP file in a sidebar widget? Recently discovered this curious plugin? Don’t, you’re about to make an awful mistake. Lets walk through why it’s bad, and what you should be doing instead. Why Might Somebody Embed PHP? Perhaps you […]
There’s a few questions I’m commonly asked about using composer + WordPress. Here they are in a super short form FAQ: To install a composer project, run: composer install To update a composer project, run: composer update Install WordPress in a folder composer require johnpbloch/wordpress @stable or in your composer.json add: { “require” : { “johnpbloch/wordpress”: “@stable” […]
When I build a WordPress plugin, I use several methods to structure things that help me greatly, all of which stem from root composition. I’m going to expand on what that is and how I use it. Every plugin has a root file that contains the plugin header comment, and gets loaded by WordPress. This […]
I’ve been doing a lot of bash scripting with WordPress, especially with WP CLI. Here are some snippets I found useful. All my scripts assume a standard wp-config.php with DEFINE() statements and no unusual logic structures. A rogue constant with the name DB_NAME may throw things off without some modification. Getting the Database table prefix If you […]
Take a look at this code, found inside the Jetpack Post Views plugin: function Jetpack_Post_Views() { $this->__construct(); } Here an object is calling its own constructor. But what’s wrong with it? The General rule for calling __construct: The only occasion it is okay to call a constructor method directly, is in a child class that […]