WordPress.org

Ready to get started?Download WordPress

Forums

My first (string-replacing) plugin (2 posts)

  1. Palee
    Member
    Posted 4 years ago #

    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');
  2. Palee
    Member
    Posted 4 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags