There are at least a dozen places on the web where you can find a discussion forum for help building WordPress sites including WordPress Development, WPChat, Advanced WordPress and PostStatus' Slack to name four. And on those various forums hardly a week goes by when someone does not ask a question of the form: "How… Continue reading
Author Archives: mikeschinkel
Embrace the Circularity! Recursion in PHP for WordPress
Background I recently commented on Tom McFarlin’s blog post entitled “Updating a WordPress Post in the Save Post Action” and suggested the use of a simple static variable rather than go through the hassle of removing and re-adding the save post hook. Tom’s response was he hadn’t thought of it but that he avoids recursion… Continue reading
Hardcore URL Routing for WordPress
I’m giving a presentation at WordCamp Atlanta today and so I’m providing a copy of my presentation for attendees to more easily follow along. Hardcore URL Routing for WordPress [PDF] (~1mb) And if you can’t make it to the WordCamp today, then lucky you; no need to attend! UPDATE: And on SlideShare: Hardcore URL Routing… Continue reading
Always Omit Closing PHP Tags in WordPress Plugins
Reader Odai left a great question in his comment today on our plugin tutorial: Looking at the code for The Complete Plugin, do you need to have a closing ?> for the opening <?php? Or is it okay to just end with a }? I learned the answer to this a long time ago, so… Continue reading
Adding a Banner Image to your WordPress Plugin Page
As of December 2011 every plugin hosted on WordPress.org has the option to display a visually pleasing banner image at the top of its plugin page. If you are publishing a quick ad-hoc plugin you might not want to go to the effort, but for everyone else, especially plugins that represent a brand we consider… Continue reading
Submitting your Plugin for Hosting on WordPress.org
Our company builds custom WordPress plugins for clients to be published in the WordPress.org plugin repository. As we are about to publish another client plugin it's a great time to write about the processes for submitting a plugin to the WordPress plugin repository. Note this post is only about submitting your plugin; we'll cover actually… Continue reading
Initializing Singleton Classes used in WordPress Plugins
After one of our earlier posts Eric Mann whose opinion we highly respect initiated a conversation with me over Twitter’s DM where he expressed a dislike for the HardcoreWP approach and stated a preference for using ::get_instance() instead: While this approach is perfectly workable and truth be told it’s mostly just personal preference we still… Continue reading
Using Singleton Classes for WordPress Plugins
In our last post "Enabling Action and Filter Hook Removal from Class-based WordPress Plugins" we offered the following as a suggested template for coding WordPress plugins:
Enabling Action and Filter Hook Removal from Class-based WordPress Plugins
In our tutorial “Using Classes as Code Wrappers for WordPress Plugins” we took a plugin that used a global function for its filter hook and converted it to using a PHP class as a code wrapper. Unfortunately the approach we showed didn’t allow other plugins and/or themes to remove or chain the actions and/or filters… Continue reading
Using Classes as Code Wrappers for WordPress Plugins
Many tutorials that explain how to write a WordPress plugin (including ours) show the use of global functions for implementing action and filter hooks. In our case we used global functions so we had less to explain. But now that we’ve gotten past that first tutorial we think once you understand using classes you’ll find no… Continue reading