WordPress.org

Ready to get started?Download WordPress

Forums

WP Content Filter: Possible to replace text with nothing? (5 posts)

  1. Gestroud
    Member
    Posted 4 years ago #

    Hello dgwyer,

    I had made some changes in the plugin's code so that I could replace text with nothing rather than replacing it with other text characters. The recent upgrade overwrote my changes, but I believe that I can restore them easily enough.

    I'm wondering: Would it be possible for you to add an option to the plugin to replace text with nothing in addition to the other options? If you need the changes I made to the old code, here it is.

    if($wildcard_char == 'star'){
    $wildcard = '*';
    } else if($wildcard_char == 'strn') {
    $wildcard = '$';
    } else if($wildcard_char == 'quest') {
    $wildcard = '?';
    } else if($wildcard_char == 'excl') {
    $wildcard = '!';
    } else if($wildcard_char == 'dash') {
    $wildcard = '-';
    } else if($wildcard_char == 'hash') {
    $wildcard = '#';
    } else if($wildcard_char == 'tilde') {
    $wildcard = '~';
    } else {
    $wildcard = '';
    }

    The only problem with the addition is that if you visit the plugin's options page, you have to re-set the option for no replacement.

    http://wordpress.org/extend/plugins/wp-content-filter/

  2. David Gwyer
    Member
    Posted 4 years ago #

    Apologies for the upgrade overwriting the plugin settings. I'm afraid the old version blanked keywords every time the plugin was deactivated/reactivated. So releasing any new version of the plugin would always overwrite previous settings. This is now no longer the case with the new version.

    Also the 'back end' options were completely overhauled to make use of the WordPress Settings API - so this is why the other plugin options were reset too. Again, this won't happen in future upgrades. Your keywords and plugin settings will remain persistent.

    As for your feature request I had not considered replacing flagged keywords with a blank string. If you really need this feature then of course I will add it to a future version. Does anyone else need this feature adding, or more choice of rendering options on the front end when a keyword is encountered?

    Another option I was considering adding is an additional filtering character option [string] where you could choose this from the drop down box and enter a new string to show up in place of flagged keywords, such as 'bleep' etc.

    Thanks again for the comment.

    David

  3. David Gwyer
    Member
    Posted 4 years ago #

    Hi gestroud,

    Just to let you know, as per your feature suggestion the plugin has now been updated with an additional option to 'blank' out flagged keywords.

    David

  4. Gestroud
    Member
    Posted 4 years ago #

    Thank you. Wish there was a donation box on your site.

  5. David Gwyer
    Member
    Posted 3 years ago #

    If you wish to contribute to our FREE Plugin development then an excellent way is to sign up to our support forums for a low monthly fee. See here for more details:

    http://www.presscoders.com/wordpress-support/

Topic Closed

This topic has been closed to new replies.

About this Topic