Stephen Harris
Stephen is a Mathematician, Christian & WordPress developer all rolled into one, oddly human shape. He's the author of the event management plug-in Event Organiser.
Tutorials
  • Code
    Integrating With WordPress’ UI: Meta Boxes on Custom PagesIntegratingwithwordpressadminui metaboxes
    19 shares
    This is part 2 of a series looking at how your plugin and theme can provide the best user experience by 'fitting in' with WordPress' native UI. This means more than just looking a part of WordPress (which we covered in part one), but where appropriate, mimicking the same workflow that would (hopefully) be familiar to WordPress users. A part of this, is how you structure pages and present information the end user. An incredibly useful tool from both a UI and developer perspective is the meta box. In this tutorial we look at how you can add meta boxes to your own custom admin page.Read More…
  • Code
    Integrating With WordPress' UI: The BasicsIntegratingwithwordpressadminui
    11 shares
    It’s long been widely accepted that one of the biggest advantages WordPress has over its competitors is its admin user interface. It is, on the whole, very easy and intuitive to use. Furthermore it’s being constantly refined and improved, with the media upload screen now one of the many things under scrutiny. Unfortunately, there is something that the WordPress-UI team have no control over, which consistently undoes all their hard work: plugins and themes. Your plugin’s UI (I shall use the term plugin in this article, but the same applies to your theme's UI) is one of the most important aspects of your plugin. It defines how people interact with it, how easy it is to use, and perhaps even how much they enjoy using it. This is the ultimate aim of your plugin: to make a particular task, or tasks, easier for your end user (in fact this is the seemingly forgotten aim of computers themselves). The UI should be attractive, but ultimately it should be functional. When deciding how to layout your plugin, you need to decide how to make your plugin easy to use - better yet, get feedback - this is essentially what WordPress is doing.Read More…
  • Code
    Quick Tip: Get the Current Screen's HooksCurrent screens hooks
    10 shares
    Wherever possible it's better to use screen-specific hooks rather than more generic init, admin_init, admin_footer etc. (unless you specifically want your callback to run on every screen). In this quick tip we'll look at how you can easily obtain the screen hooks for any particular page.Read More…
  • Code
    Interacting with WordPress' Plug-in & Theme APIInteractingwithwordpressapi
    7 shares
    The WordPress Repository API is the API used to fetch plug-in and theme information for use on your admin pages. For instance it displays the latest plug-ins on the dashboard, allows you to view themes on your theme tab and allows you to search for, and install, plug-ins straight from the repository. In this tutorial we're going to look at how this API works and how it can be used to access information such as your plug-in's rating, how many times it's been downloaded, or even its ReadMe sections. Using this API, for instance, you can host a link on your website that will always point to the latest version of your plug-in or theme.Read More…
  • Code
    Capabilities and NoncesThumb
    11 shares
    In this previous article I looked at helping keep your theme or plug-in secure through appropriate data sanitization and validation. In this article, we'll be looking at another important aspect of WordPress security: capabilities and nonces.Read More…
  • Code
    How to Create a Recent Tweets WidgetPreview
    19 shares
    In this tutorial we'll look at how to create a 'recent tweets' widget. There are a fair number of twitter-related plug-ins in the repository, however I hope that this tutorial will cover some of the important (and generally applicable) methods needed for creating such a plug-in, (whether Twitter based or not).Read More…
  • Code
    Data Sanitization and Validation With WordPressSanitization and validation preview
    47 shares
    Proper security is critical to keeping your site or that of your theme or plug-in users safe. Part of that means appropriate data validation and sanitization. In this article we are going to look at why this is important, what needs to be done, and what functions WordPress provides to help.Read More…
  • Code
    The Rewrite API: Post Types & TaxonomiesPreview
    22 shares
    This is part two of a series looking at WordPress' Rewrite API. In part one we took a whistle stop tour of the basics of WordPress' Rewrite API. In this tutorial we will look at the rewrite settings available to us when registering a post type or taxonomy. While custom post types and taxonomies (unlike the default posts, categories and tags) don't benefit from any Settings -> Permalink interface, setting up rewrites for custom types is still fairly straightforward. We'll also be using the methods introduced in part one, so if you haven't already I recommend you read WordPress' Rewrite API Part One: The Basics.Read More…
  • Code
    The Rewrite API: The BasicsPreview
    18 shares
    This is part one of a two part series looking at WordPress' Rewrite API. In this tutorial we look at how rewrites work and the basic methods available to create custom rewrite rules.Read More…
  • Code
    Understanding the Walker ClassPreview
    41 shares
    Menu items, pages and (hierarchical) taxonomies are all examples of data with a tree like structure: terms can have parents, children and siblings. Usually we would like to reflect this structure in the HTML markup. For displaying a menu, for instance, we want the HTML to be of a list of 'top level' links, with nested lists of their children, which themselves contain nested lists of their children, and so on. This tutorial will guide you through a class WordPress provides which makes producing this mark-up extremely simple.Read More…
  • Code
    Add Post Type Archive Links to Your MenuPreview
    15 shares
    A common request, particularly for those who have created custom post types like 'News' or 'Events', is to add a link to their post type's archive page on their navigation menu. Currently, however, this can only be done by manually entering the post type archive URL. Apart from being fairly inelegant, this solution has a few drawbacks: it doesn't always appear as 'current', if you change your permalink structure it could break the link, manually adding the URLs is tedious and the link does not appear as 'current' when on a post of that post type. In this tutorial I will show you how to produce a plugin that creates a meta-box on your Appearance -> Menu page which allows you to add post type archive links. These links don't suffer from the drawbacks mentioned above.Read More…
  • Code
    Publishing WordPress Plug-Ins With GitPreview
    11 shares
    If you've got a plug-in hosted on the WordPress repository then you'll be fairly familiar with SVN and some of its commands. In this tutorial I'll show you how you can use Git, another version control system popularised by GitHub, to publish and maintain your plug-in.Read More…