Monday, January 25, 2016

Design a system: WordPress event management

In a previous article, we went over the concept of events and event listeners. These were classes who were in charge of a specific aspect of an application. This was a more abstract job that touched several parts of an application. We also saw how you could design these event listeners in WordPress. It required that you rethink how you use the plugin API. (Yes, this is going to be another plugin API article :P) We’re going to keep going with this idea of events and event listeners. We’re going to design a system for them. We’ll call it an “event management” system. It’s an important tool in your journey to master object-oriented programming in WordPress. Before we begin, let’s do a small recap on the plugin API language. When we talk about the plugin API, we often talk about action hooks and filter hooks. Actions are is a type of signal that the plugin API emits. Anyone can listen for those signals and react to them. Filters are a bit different. They’re also a type of signal that the plugin API emits. But that signal also contains data that you can change and send back. Now while those two types of signals do different things, they’re the same under the hood. They use the same system #wordpress #smallbusiness #entrepreneur

https://managewp.org/articles/11587/design-a-system-wordpress-event-management

No comments:

Post a Comment