In addition to allow the usage of AddToAny in Europe to be compliant to the EU e-Privacy Directive it would be useful to introduce a new parameter to the additional options to prevent AddToAny from loading until a cookie has been set. The name of the cookie should be the value of the new parameter. This way administrators could use any of the existing WordPress cookie plugins. I would love to see something like
a2a_config.cookieinit = ‘name_of_the_cookie_needed_to_load_a2a’
I put this code below the is_admin if-statement in both functions:
$options = get_option( 'addtoany_options' ); if ( $options['display_in_pages'] != '1' && is_page () ) return;
Thanks for your feedback, Michael! These are good requests that will be considered in future releases. Some color:
The plugin currently loads the script [asynchronously] for most requests so that AddToAny can be reliably loaded from AJAX (widgets, infinite scrolls, etc.).
To support your use-case most immediately I think it’d be interesting to make the script functions modifiable by filters, so you can disable the script programmatically (probably in your functions.php) without having to modify the plugin itself. How does that sound?
It would be perfect to have a hook to enable/disable the script programmatically.