1

My assignment is to write a Wordpress plugin that converts every text URL [http://www.website.com] inside post content to a clickable link.

Now, I don't want you to give me a finished solution, I just need your direction towards it. What to look for, what NOT to do and so on.

I know that regular expressions should be used, but I have zero experience with it and I'm not sure where to start altogether.

Thank you!

Slavisa Perisic
  • 1,110
  • 3
  • 18
  • 32
  • 2
    You might want to check out this question: http://stackoverflow.com/questions/12538358/convert-url-to-links-from-string-except-if-they-are-in-a-attribute-of-a-html-tag/12590772#12590772 ... especially the answer by Anthony Hatzopoulos – Martin Ender Oct 03 '12 at 12:42
  • 2
    If you don't want a technically verifiable, vetted solution - Stack Overflow may not be the best place. You can indicate it as your preference, but don't be surprised if you get a complete answer, as people enjoy receiving up votes for providing them. Not closing this as an exact duplicate as WP is an additional complexity - unless you indicate that this should be closed as such and the linked post solved your problem. – Tim Post Oct 04 '12 at 03:19
  • many ways to do that. You are most likely looking for `preg_replace_all` and maybe (if you want to add more complex stuff to the link) for `preg_replace_callback.` oh and http://www.regular-expressions.info/ should help you with the pattern. – dognose Nov 21 '12 at 22:58

0 Answers0