Working with Classes and WordPress Filters and Actions

If you are like me, you love putting similar code together in a clean manner in classes. In some cases, OOP is Overworking Of PHP (smart, no?). In other cases, it saves a lot of time and repetition if you do this in an object oriented manner. If you are making WordPress plugins, you always have to hook into wordpress’ functionalities using Filters or Actions. We usually do it this way: add_filter(‘the_content’,’add_booyaa_after_content’); function add_booyaa_after_content($content) { $content .= ‘Booyaa!!’; return $content; } Now, it’s a small function. There is no need to do this in a ‘classy’ manner. But if you

Continue reading

Scroll Up