WP Development

Extending the WordPress XML-RPC API

The purpose of this article is to describe the WordPress XML-RPC API, explain how to use it, and demonstrate how to extend it to create custom API methods for interacting programmatically with WordPress. I assume a relative unfamiliarity with XML-RPC in general, WordPress XML-RPC, and spend time first covering the basics, if you want to skip straight to the section on extending the WordPress XML-RPC API, feel free to. What is XML-RPC? As defined by…

Read More

Hide Certain WooCommerce Sub-Categories in Catalog

WooCommerce provides some coarse control over displaying sub categories in your shop/category pages with the “Show subcategories on category pages” and “Show subcategories on the shop page” options on the WooCommerce > Settings > Catalog > Catalog Options section. These controls are all-or-nothing though: show all subcategories on the category pages, or show all subcategories on the shop page. If you want finer-grained control, for instance displaying only certain subcategories on the shop or particular…

Read More

SkyVerge WooCommerce Extensions

WordPress Pretty Category Permalinks Broken and Fixed

This is probably another one of those situations that applies only to me, but just in case someone else out there happens to have this same broken permalink issue, I’ll describe what happened to my site, and how I fixed it. The specifics of my setup were: WordPress 3.4.1, WordPress SEO 1.2.5, and the custom permalink structure /%category%/%postname%/. The problem that someone thankfully alerted me to (gotta get back in the habit of checking Google…

Read More

WordPress development tutorials

How to Create a Custom WordPress Post Type With Image Uploads

This article details one method of creating a custom WordPress post type with the ability to upload and attach images using the built-in WordPress Media browser. This piece does not cover all the details and nuances of creating a custom post type, as this is covered well elsewhere. In addition to highlighting the most important methods and code required, I have attached a fully functional demo plugin which you may feel free to download and…

Read More

WooCommerce reviews + tutorials

Create an Overrideable WooCommerce Template File

Sometimes when developing a WooCommerce plugin you want to output a snippet of HTML, and do so in such a way that the content can be easily overridden by a theme. It’s part of the process of crafting a well-engineered, customizable plugin. The best way to achieve this is by using WooCommerce’s own templating mechanism, and what once took some effort and some filters is now a snap thanks to one of the recent WooCommerce…

Read More

WP Development

How to Add a WordPress Plugin Action Link

I always prefer it when plugins make it as easy as possible to find their configuration page. When I install a new plugin the last thing I want to do is hunt around for some hidden menu item, I want to play around with my new toy! And what better place to link to a plugin’s configuration than right from the admin Plugins page where the plugin is activated, deactivated or (the horror!) deleted. These…

Read More

WP Development

Debugging WordPress

The following are some techniques I use nearly every day for debugging WordPress and WooCommerce, and can be used for plugin or theme development equally. Echoing or printing to the screen will only get you so far when debugging, especially in a complex framework like WordPress; to really understand the code flow, and to trace and fix issues, you need to be able to log messages to a file. For this WordPress makes use of…

Read More

GitHub Repository Not Found Workaround

Today I encountered an issue with GitHub where I was unable to fetch a remote repository to merge into my local clone. Everything seemed to be configured correctly, and I am able to fetch repositories from the same user without a problem, so it seems like there is some issue with this particular repository. Although I have a support ticket open with GitHub to try and determine the root cause of the issue, for now…

Read More

WP Development

WordPress Settings API Hidden Field

This short article covers one way of creating hidden fields with the WordPress Settings API. This is useful for more than just creating hidden input fields; for instance I used it when I wanted to render a number of checkboxes in a single field, yet still have the checkbox options managed by the Settings API. The WordPress Settings API The WordPress Settings API is a great, if poorly documented addition to WordPress. The two best…

Read More