post->post_content filter

You use preg_replace function incorrectly. This function returns replaced content: add_filter( ‘the_content’, ‘wpdu_image_replace’ ); function wpdu_image_replace( $content ) { return preg_replace( ‘/<img.*?src=”https://wordpress.stackexchange.com/questions/55241/(.*?)”.*?>/’, ‘<a href=”$1″>Image file</a>’, $content ); } Also pay attention that you don’t have to use global variable $post, because content of the post is passed to your function as first argument.

Avoid too long words in a post title, post content or comment but only if its not a url

Thank you Milo, “word-break” alone wasn’t enough as it’s css3 only and not cross-browser. But I found this: .bloc_content{ overflow:hidden; -ms-word-break: break-all; word-break: break-all; word-break: break-word; -webkit-hyphens: auto; -moz-hyphens: auto; hyphens: auto; } It seems to to work in all cases I tested. Hopefully it would be cross-browser enough to solve the problem. Not sure … Read more

regEx wp core file

I was able to answer my own question. Simply adding a 0-9 into the code above remedied the situation. Here is the final code: if (!name || !/^[a-z0-9][a-z0-9\-\_:\.]*$/i.test(name)) { tinyMCEPopup.alert(‘advanced_dlg.anchor_invalid’); return; }

Redirect Loop in Regex Moving to HTTPS

RESOLVED: This issue came about from many warnings in Bing Webmaster Tools. I discovered that I had added these sites to “My Sites” before I moved them over to HTTPS. I had to delete the sites from BWT and add them back again. It now shows that they’re being crawled correctly. Another coder over at … Read more