Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //attaches in-reply-to classes to the first link in the post
- function the_content_in_reply_to_callback($matches){
- if(preg_match('`href=.mailto`i',$matches[0])){
- return $matches[0];
- }else{
- return '<a class="u-in-reply-to" rel="in-reply-to" '.$matches[1].'>'.$matches[2].'@'.$matches[3].'</a>';
- }
- }
- function the_content_in_reply_to_filter($content) {
- return preg_replace_callback('`\<[aA] (.*?)>(.*?)\@(.*?)</[aA]>`','the_content_in_reply_to_callback',$content,1);
- }
- add_filter( 'the_content', 'the_content_in_reply_to_filter' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement