WordPress.org

Forums

Text filter plugin (4 posts)

  1. kuratkull
    Member
    Posted 8 years ago #

    Hello, I have used WordPress for some time now. Anyway, I have been looking for a simple post-text-filter.

    Here is how i imagine it:
    1. I open up the properties of the filter and enter "pre" in the box.
    2. Tick one of these options: "Delete", "Replace"(when selecting this, a new box appears, where i can write the word to replace the old word).
    3. And when my posts(to-be) or all post already existing, are filtered, it either removes or replaces the text.

    It would be nice if there would be a random variable filtering too.
    Example:
    I have lots of links in my blog, like: http://www.somepage.com/myuseridorsomething.php?=1234
    http://www.somepage.com/myuseridorsomething.php?=4214
    etc.

    So i enter the word

    http://www.somepage.com/myuseridorsomething.php?=xxxx

    And the xxxx part is to be replaced or deleted.

    Would really appreciate it, if someone would write this for me(the community). I bet other users would appreciate this plugin too :)

    Please let me know.

  2. stoi2m1
    Member
    Posted 8 years ago #

    Use something like this in a plugin of your own:

    function xx_generate($content) {

    $content = str_replace("xxxxxx", yyyyyy, $content);

    return $content;

    }
    add_filter('the_content', 'xx_generate');

    the x's will be replace with y's. Be aware that this will replace anything that contains the same contents of the x's with the y's.

    Goodluck

  3. kuratkull
    Member
    Posted 8 years ago #

    Thanks, i will definately try this :)

  4. jwurster
    Member
    Posted 8 years ago #

    There are 2 plugins I've used to help me do this. One is called w-p and the other is acronym replacer (or acronym replacer revisited).

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags