Learn Plugin Development
200 tutorials and 12 series, ready when you are.
Checking if a dependent plugin is active
When you write plugins that depend on others, such as extensions for Easy Digital Downloads, you often need to check if the dependent plugin is active and only perform certain actions if it is. There are several ways to check if a plugin is active and I’d like to walk you through some of them.
Using the WordPress Heartbeat API
WordPress 3.6 introduced a new API called the “WordPress Heartbeat”. This is the API that behind a lot of the improvements in WordPress 3.6, including better revision tracking, user’s session management, and more. I’m going to show you a quick example of how you can use the API to perform “live” actions. What is the…
Get all media attached to a post
WordPress 3.6 introduced the new get_attached_media() function that makes it really simple to retrieve all media attached to a specific post.
Retrieving the image URLs from all gallery images in a post
WordPress 3.6 introduced quite a few new functions that are helpful when working with media attached to a post. One of my personal favorites is a helper function that lets you retrieve the URLs of images that have been inserted as parts of galleries in the post.
Use the_title() and the_title_attribute() Correctly
WordPress provides a nice little function for displaying the title of the current post: the_title(). This function gets used all over the place: in the site header, at the top of single posts and pages, in the loop, in the footer, etc. It is probably one of the most commonly used functions by theme developers,…
Template Files in Restrict Content Pro
Restrict Content Pro, my plugin for selling premium memberships and restricting site content to paid subscribers, includes a template files system that makes it really simple for users to customize the registration form, profile form, login form, and more. This quick tutorial will walk you through how to use them to make modifications to the…
Plugin Development 101 – Separating Your Plugin into Multiple Files
Storing Session Data in WordPress without $_SESSION
The term Session in web development refers to a general method of storing semi-permanent data, such as user logins, user interactions, ecommerce shopping carts, and many other examples. PHP has a system called $_SESSION, which is exceptionally simple to use, but has same major draw backs, including security issues, and intermittent support across server environments. A few months…
Test Your Plugins with RTL
Right-To-Left languages are those that start on the right and move to the left, in terms of word order and letters. By default, WordPress runs in Left-To-Right mode, but there are thousands and thousands of WordPress users that read RTL. One of the points that most WordPress plugin developers fail on is testing and ensuring…