WordPress Pass Variable Into wp_footer, wp_head, & all Other Actions/ Hooks/Filters »
Passing variables into WordPress hooks using an anonymous function I thought was impossible. I always worked around this and rewrote the logic. Today I found out anonymous functions support a use keyword, allowing passing: View the code on Gist. So simple and easy. Shaves hours of troubleshooting.