Created
January 28, 2019 19:11
-
-
Save DeVoresyah/9a4895b2604d74716702668e2b44dd9d to your computer and use it in GitHub Desktop.
Ipeenk Plugin
This file contains hidden or 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
function safelink_converter( $content ) { | |
global $post; | |
if ( is_single() && isset( $post->post_author ) ) { | |
$display_name = get_the_author_meta( 'nickname', $post->post_author ); | |
} else { | |
$display_name = "admin"; | |
} | |
$content = $content . '<script type="text/javascript"> | |
var sconfig = { | |
safepage_url: "https://ipeenk.adsafe.click/p/skip.html?hash=", | |
username: "' . $display_name . '", | |
prtoect_link: "facebook.com,adsafe.click,twitter.com,youtube.com,vorecorp.id" | |
} | |
</script> | |
<script src="https://rawcdn.githack.com/VoreCorporation/Customer-Host/67738f6c4d558b1784a354e7addfccf4bd90036b/js/ipeenk-safelink.min.js" type="text/javascript"></script>'; | |
return $content; | |
} | |
// Add our function to the post content filter | |
add_action( 'the_content', 'safelink_converter' ); | |
// Allow HTML in author bio section | |
remove_filter('pre_user_description', 'wp_filter_kses'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment