Support » Plugin: Seriously Simple Podcasting » 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 using remove_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-hooks

    I’d love to see this changed in a future revision so this code can be removed/modified using the standard tools WP provides.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Craig Hewitt

    (@podcastmotor)

    HI Kenn,

    Thank you for the message. This is definitely something that we will look into and will look to resolve in the next version of the plugin. Hopefully we’ll be releasing that in the next couple of weeks.

    Will keep you updated as to the progress of this here as we get towards resolution.

    Craig

    Thread Starter kw

    (@kchrist)

    Great, thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Anonymous function usage with add_action’ is closed to new replies.