WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Simple Tags] Suggestion: Limit auto tag to first tag it finds (4 posts)

  1. Patrick Daly
    Member
    Posted 6 years ago #

    Sometimes I use a word 20 times in one post but don't want every word to be linked by the auto tagger. Could you work in a feature that lets you choose to link all occurrences of the word or just the first occurrence?

    Thanks! You've done an awesome job with this plugin - it's my favorite by far.

  2. Anonymous
    Unregistered
    Posted 5 years ago #

    Agreed. I actually visited this forum hoping to figure out how to accomplish this, but I guess it isn't a feature yet.

    Also, I am assuming the previous poster is referring to the "auto link" functionality, not "auto tags".

  3. Jasonpaul
    Member
    Posted 5 years ago #

    I'm also trying to find a solution to this and am suprised it hasn't been implemented.

  4. lonewolfonline
    Member
    Posted 5 years ago #

    Also looking for this feature.

    A quick hack which works for me is to modify simple-tags.client.php for the version of wordpress in use (in my case 2.5). This only works on PHP5+

    Find function autoLinkTags (~line 247) and a bit further down find $token = preg_replace($match, $substitute, $token); // only PHP 5 supports calling preg_replace with 5 arguments

    Add an extra parameter to preg_replace at the end with the value of 1 so it becomes:

    $token = preg_replace($match, $substitute, $token, 1); // only PHP 5 supports calling preg_replace with 5 arguments

    This will match the first occurance of a word/tag in a paragraph. Not ideal, but its better than every tag.

    I'll leave it for the plugin author to make the necessary changes to the actual plugin ;) Hopefully in the next version.

Topic Closed

This topic has been closed to new replies.

About this Topic