Forums

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

  1. Palee
    Member
    Posted 2 months 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 2 months 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?

Reply

You must log in to post.

About this Topic

Tags