Help Scout documentation search with Gravity Forms

Gravity Forms is a tremendously powerful plugin for WordPress and Help Scout is an awesome customer support system that also provides a service for handling documentation. What they miss, however, is a direct connection that allows site owners to provide customers with a way to search the Help Scout documentation before they can submit a support ticket submission form.

Using wp_remote_get() to parse JSON from remote APIs

WordPress includes an exceptionally useful API called the HTTP API that can be used for sending data to and retrieving data from remote APIs. If you are building a plugin that talks to Stripe, MailChimp, or just about any other service that provides an API, you can use the WP HTTP API to make your job significantly easier. For this tutorial, I’m going to show you how to use wp_remote_get(), one of the several functions included in the HTTP API, to retrieve and parse JSON data from a remote API.

Unit Tests for WordPress Plugins – The Factory

For many plugins, writing adequate unit tests requires the creation of sample post, user, taxonomy, and other data inside of the test WordPress install. While the standard WordPress functions for creating data, such as wp_insert_post(), work just fine, WordPress provides a set helper classes called WP_UnitTest_Factory that make it exceptionally simple.

Shortcodes 101 – Shortcode Attributes

In the Basics of the Shortcode API, we briefly covered shortcode attributes and the shortcode_atts() function. Now it is time to dive deep into setting up attributes for shortcodes and learn a few tricks can that be exceptionally helpful when building shortcodes in your plugins or when modifying the shortcodes of other plugins.

Determine if a script has been enqueued or registered

WordPress provides a nice, simple API for loading scripts in plugins and themes. We use the wp_enqueue_script() and wp_register_script() to instruct WordPress to load the scripts we need, and it works exceptionally well. Sometimes, however, we don’t need to just load a script, but instead we need to detect if a specific script has been…

Use SCRIPT_DEBUG to enable non-minified asset files

This is a little trick that took me several years to learn but is extremely useful. By default, WordPress loads minified versions of CSS and JS files in order to have a small impact on load times. This is excellent, but for development purposes, it can be a pain if you are trying to work…

Get array of all URLs in a string

WordPress 3.7 introduced a new function called wp_extract_urls(). This is a handy function that allows you to extract URLs from text strings. Simply pass the text string to the function and it will return an array of URLs.

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…