Adding a Draggable/Sortable Multi-Checkbox Control to the WordPress Customizer

Justin Tadlock has made the world an offer: Come up with an idea for a new control in the WordPress customizer, and he’ll provide some help in coding it, or suggest a contact who perhaps can. Today, he blogged about a multi-checkbox control, which I have been working on lately as well. My example incorporates a sortable/draggable interaction that I’d like to add to the discussion via a brief tutorial.

When I say draggable/sortable, I am referring to the jQueryUI interaction. Here’s how it would look when we’re done:

more… Adding a Draggable/Sortable Multi-Checkbox Control to the WordPress Customizer

WordPress Function for Performing a Plugin Update Routine — Or Not?

Today I was updating my Ecwid plugin such that the widgets load via ajax. One of the steps there involved creating a url that would respond to requests for widget markup, such that I could easily feed that url to jQuery’s excellent load() function. However, when I pushed this from my local to one of my test installs that’s actually on the web, I found that the url was 404’ing because I needed to flush the rewrite cache. I wouldn’t want my plugin users to have to do that themselves, so I added a class to my plugin to perform arbitrary functions upon plugin update.

more… WordPress Function for Performing a Plugin Update Routine — Or Not?

WordPress Function to Create a Breadcrumb Navigation Menu

The first time I started using breadcrumbs was as a part of the Yoast SEO plugin. While that’s a very well-written and successful plugin, I do think it oversteps its bounds in many ways, and I prefer not to install it for several reasons. The main one is that it adds so much functionality to wp-admin that it ends up confusing admin users. It also gives them the ability to jam keywords that may be doing them more harm than good.

But I do appreciate the breadcrumbs, and they’re really tricky to create! To that end, I came up with my own template tag for breadcrumbs, and it responds to a variety of views, to include single, search, custom post types, and 404. It also “crumbs down” into child posts or child terms of the current view.

Here’s the gist.

As a word of warning, this function contains references to other functions from my theme that you probably won’t have running, so, as always, read it and understand it before you use it. That said, you can also check out the helper functions referenced in the main breadcrumbs function.

WordPress Plugin to Log JS Errors in a Page

At my day job, we’re looking at a way to migrate a large number of sites from an outdated WordPress install to a current one. I believe that our biggest problem will be the differing versions of jQuery. To that end, I created this plugin, to log JavaScript errors to a page.

more… WordPress Plugin to Log JS Errors in a Page

WordPress JSON Rest API Shortcode & Tutorial

They say you’re supposed to write with one specific person in mind, instead of writing for everyone. In this case, I’m writing for, well, me. Specifically, me before I spent about 4 hours hello-worlding the new WordPress JSON Rest API yesterday. I found the existing documentation to be a little too advanced or vague for my humble skill set. To that end, I’ve written a shortcode to bundle up what I learned and to help you hello-world it yourself:

more… WordPress JSON Rest API Shortcode & Tutorial