DEV Community

Discussion on: Simplifying WordPress's functions.php with OOP

Collapse
 
tylerlwsmith profile image
Tyler Smith

I'm glad you got some value out of the post! I hadn't even considered using this for ajax, but I'll have to try it out at some point.

Collapse
 
zimaben profile image
Benny T

Yeah it works in this case since wp_ajax follows a standard naming convention with your function and PHP will natively try to execute a variable as a function if you put the () parens after, so declaring the function name pulls double duty here.