Skip to content

Instantly share code, notes, and snippets.

@BhargavBhandari90
Last active May 17, 2017 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BhargavBhandari90/b265e7d8c958a57760ae73d0162dc468 to your computer and use it in GitHub Desktop.
Save BhargavBhandari90/b265e7d8c958a57760ae73d0162dc468 to your computer and use it in GitHub Desktop.
Remove link of url preview from activity
<?php
// Add this function to theme's functions.php
// Check if function doest not exists.
if ( ! function_exists( 'rtmedia_wp_footer_add_js_remove_link' ) ) {
/**
* Remove link from activity url preview content.
*/
function rtmedia_wp_footer_add_js_remove_link() {
?>
<script type="text/javascript">
jQuery( function($) {
function remove_site_url() {
jQuery( '.rtmp_link_preview_container' ).each(function(e) {
var previewurl = jQuery(this).children('a').attr('href');
jQuery(this).parent('.rtmp_final_link').siblings('p').find('a').each(function(e) {
var otherurl = jQuery(this).attr('href');
if ( previewurl==otherurl ){
jQuery(this).hide();
}
jQuery( '.activity-inner' ).show();
});
});
}
remove_site_url();
// Remove target blank when new elements are added
jQuery( '#activity-stream' ).bind( "DOMSubtreeModified", function() {
remove_site_url();
});
});
</script>
<?php
}
}
add_action( 'wp_footer', 'rtmedia_wp_footer_add_js_remove_link' );
?>
// Add this to custom css ( rtMedia->settings->Custom CSS )
#activity-stream .activity-inner {
display: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment