Skip to content

Instantly share code, notes, and snippets.

@SalvatoreNoschese
Last active November 27, 2023 23:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
mu-plugins | addtoany
<?php
/*
Plugin Name: AddToAny Filter
Description: Add AddToAny after content
Author: Salvatore Noschese
Author URI: https://salvatorenoschese.it
Version: 1.0
*/
defined( 'ABSPATH' ) || exit;
add_filter('the_content', 'custom_add_to_any_after_content');
if (!function_exists('custom_add_to_any_after_content')) {
function custom_add_to_any_after_content($content) {
if (is_single())
{
$content .= '
<!-- AddToAny BEGIN -->
<div class="a2a_kit a2a_kit_size_32 a2a_default_style print-no">
<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" />
<strong>ShareMe:</strong>
<br />
<a class="a2a_dd" href="https://www.addtoany.com/share"></a>
<a class="a2a_button_facebook"></a>
<a class="a2a_button_reddit"></a>
<a class="a2a_button_twitter"></a>
<a class="a2a_button_telegram"></a>
<a class="a2a_button_whatsapp"></a>
<a class="a2a_button_copy_link"></a>
<a class="a2a_button_email"></a>
<a class="a2a_button_printfriendly"></a>
<br />
<hr class="wp-block-separator has-alpha-channel-opacity is-style-wide" />
</div>
<script async src="https://static.addtoany.com/menu/page.js"></script>
<!-- AddToAny END -->
';
}
return $content;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment