Anonymous function usage with add_action
-
I’m integrating SSP into a site and am going through the process of removing some unnecessary CSS/JavaScript that the plugin loads automatically.
I’ve run into one problem though: SSP loads a large chunk of inline CSS into my page footer on each page that cannot be removed using WP actions. The code in question is at the bottom of
class-ssp-frontend.php, and begins with:add_action( 'wp_print_footer_scripts', function(){ ?> <style type="text/css">The use of an anonymous function with
add_action()makes this code impossible to remove usingremove_action(), as the removal function requires the name of the function to remove.There’s more information about this being a problem here (although not specific to SSP):
https://stackoverflow.com/questions/31240432/anonymous-functions-in-wordpress-hooksI’d love to see this changed in a future revision so this code can be removed/modified using the standard tools WP provides.
Thanks!
The topic ‘Anonymous function usage with add_action’ is closed to new replies.