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…

Your First WordPress Plugin Course on WPSessions

I am thrilled to announce the launch of a new plugin development course for those wanting to begin their adventure into the world of WordPress plugin development. It is an introductory course that walks you through every step of writing a plugin from start to finish. The course focuses on writing a simple, yet very…

Custom Capabilities in Restrict Content Pro

Restrict Content Pro, my plugin for selling access to premium content, extends the roles and capabilities API in WordPress, allowing you to fine tune the levels of access each user role has to the admin pages for Restrict Content Pro. This means that you can easily setup user roles that only have access to the Members area,…

A look at the posts_where filter in WordPress

The WP_Query class in WordPress is extremely robust and allows you to construct just about any kind of query you need for retrieving data from the wp_posts table, but there are still scenarios you will encounter when building your plugins that WP_Query doesn’t support. Before WordPress 3.7, the posts_where filter was used primarily for setting up date-range queries and…

Adding Custom User Fields to Restrict Content Pro

It is very common for users of Restrict Content Pro to want to add custom fields to the registration and profile forms so that members can enter and store additional information, perhaps for their location, profession, or personal interests (or anything else). I have shown how to add these kind of fields before, but the…

Tips for getting your plugin approved on WordPress.org

There are a lot of plugins on WordPress.org (more than 30,000) and there are a huge number of new plugins submitted to the repository every single week. What you may not know is that there are only two people that review the vast majority of the plugin submissions each week: myself and Mika Ipstenu (she does far…

Integrate Gravity Forms and Easy Digital Downloads

Gravity Forms is undisputedly the most powerful forms plugin for WordPress, and Easy Digital Downloads is (in my opinion) one of the best ways to sell digital products through WordPress, so what could be better than integrating the two plugins and leveraging the awesome power and control that they bring as a team? Not much…

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 comments from an array of user IDs

The get_comments() function, which is simply a wrapper for the WP_Comment_Query class, allows you to easily query comments posted by a specific user, but what if you wanted to get comments posted from multiple users? Currently, you have two options: a custom database query or using a filter to modify the WHERE clause of the…