mu-plugins | addtoany
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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