Replies
I just found out its an encoding problem that can occur on old post when database has been migrated,
I tried this code but it did not work
function fix_weird_characters() { global $wpdb; $replacements = array( '“' => '“', 'â€' => '”', '’' => '’', '‘' => '‘', '—' => '–', '–' => '—', '•' => '-', '…' => '…' ); foreach ($replacements as $key => $value) { $query = $wpdb->prepare( "UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, %s, %s)", $key, $value ); $wpdb->query($query); } } add_action('wp_loaded', 'fix_weird_characters');
I also have this code
function open_external_links_in_new_tab_bp_activity( $query_string, $object ) { if ( $object != 'activity' ) { return $query_string; } ?> <script type="text/javascript"> var links = document.getElementsByTagName("a"); for (var i = 0; i < links.length; i++) { var link = links[i]; if (link.hostname != window.location.hostname) { link.target = "_blank"; } } </script> <?php return $query_string; } add_filter( 'bp_ajax_querystring', 'open_external_links_in_new_tab_bp_activity', 10, 2 );