WordPress.org

Ready to get started?Download WordPress

Forums

Formatting (make_clickable) (3 posts)

  1. toomaat
    Member
    Posted 1 year ago #

    Is there any way to add a target="_blank" to url's from a string using make_clickable formatting function?

  2. vtxyzzy
    Member
    Posted 1 year ago #

    You may be able to use a preg_replace to do what you want:

    $clickable = make_clickable($string);
    $target_blank = preg_replace('/<a /','<a target="_blank" ',$clickable);
    echo $target_blank;
  3. toomaat
    Member
    Posted 1 year ago #

    Thx for the feedback!

Topic Closed

This topic has been closed to new replies.

About this Topic