Skip to content

Instantly share code, notes, and snippets.

@elvismdev
Last active July 6, 2017 06:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elvismdev/f505188a22b95de0fe45239e63098824 to your computer and use it in GitHub Desktop.
Save elvismdev/f505188a22b95de0fe45239e63098824 to your computer and use it in GitHub Desktop.
Controls the display of the AddThis Sharing Sidebar style using the show/hide Addthis sharing radio buttons in admin post add/edit page. When using the plugin Share Buttons by AddThis for WordPress (https://wordpress.org/plugins/addthis/), this code snippet aims to resolve this problem described here https://wordpress.org/support/topic/include-a…
<?php
/**
* Controls the display of the AddThis Sharing Sidebar style using the
* show/hide Addthis sharing radio buttons in admin post add/edit page.
*/
add_action( 'wp', 'ctrl_addthis_sidebar' );
function ctrl_addthis_sidebar() {
if ( get_post_meta( get_the_ID(), '_at_widget', true ) == 0 ) {
global $AddThis_addjs_sharing_button_plugin;
remove_action( 'wp_footer', array( $AddThis_addjs_sharing_button_plugin, 'output_script' ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment