php - How do I find and replace words in wordpress -


i developing plugin used find , replace words. far have code , not seem work.

function replace_content($content){     $wp_post = get_the_content();     $content = str_replace('lorem',' ronny',$wp_post);     return $content;  } add_filter('the_content','replace_content'); 

any highly appreciated.

found solution. content in capital letters, used str_ireplace() instead of str_replace() function ignore case.


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -