I’ve posted before about using hooks in WordPress. I think it would be good to write a more advanced post on the topic, including things such as: Why you usually shouldn’t use anonymous functions (aka “Closures”) attached to hooksWhy you sometimes should use anonymous functions attached to hooksBest practices for using hooks with class objects Somewhat [more…]
These posts are meant to be quick ideas that I may want to explore later, whether as a blog post or a project.
Note: the following example is wrong*. Do not do it! I often see code like the following: do_shortcode( ‘[some_shortcode]’ ); I want to explain the proper way of manually running shortcodes using PHP. *Ok, it’s not strictly wrong, it’s just not the best solution all the time.
There are a lot of libraries out there for generating HTML forms using PHP. So far, however, I haven’t found one that meets both of these things: Simple, OOP usage.Flexible enough rendering that I can use it anywhere, but especially within a WordPress plugin. A bonus option would be a library that can be included [more…]