Journal entries tagged “PHP”
Using Tailwind CSS in a WordPress Environment
To develop themes and plugins, I use the @wordpress/scripts package to do the build work. It comes with pre-defined webpack configs which work well for creating blocks and working within the requirements of the block editor. This post will assume you have familiarity with setting up your dev environment to make use of @wordpress/scripts. Recently […]
Using a Vue app within a WordPress plugin
Creating a full-fledged Vue.js application inside a WordPress plugin takes a little bit of special setup to the two code libraries working together. Here I’ll show the way I’ve been solving this, though I’m sure it’s not the only way. I’m going to skip a number of prerequisites: I’ll assume you already have the vue-cli […]
Debugging WordPress Rewrite Rules
If you’ve ever tried to use WordPress’ rewriting functions, let alone debug them, you know pain. The terror that this experience visited on me spurred me to create this drop-in function which prints a list of all the current rewrite rules (in order), and highlights which rule was matched for the current view. You could […]
Using AJAX in WordPress
Most of the work of setting up an ajax action in the WordPress environment happens in php-land. The PHP File Register & enqueue your script. In this example, I’ll assume the script has already been registered. wp_enqueue_script( ‘myscript’ ); *I’ve had trouble when I’ve tried to enqueue the script at the wp_enqueue_scripts action and added […]