WordPress.org

Support

Support » Plugins and Hacks » My first (string-replacing) plugin

My first (string-replacing) plugin

  • Hello,

    I have “written” my first plugin, but however simple is that, it doesn’t work flawlessly.

    It is supposed to replace all ‘a’ letters to ‘xxx’ in the content.

    But it only replaces them in 2 posts out of 4.

    function automatic_link ($text) {
    
    $text = str_replace('a', 'xxx', $text);
    	return $text;
    }
    
    add_filter('the_content', 'automatic_link');
Viewing 1 replies (of 1 total)
  • I’m sorry I haven’t asked your help specifically, so…

    Can you think of any reason that applies this string replacing filter differently to posts?

Viewing 1 replies (of 1 total)
  • The topic ‘My first (string-replacing) plugin’ is closed to new replies.