links_add_target


links_add_target ( $content, $target = '_blank', $tags = array('a') )

Parameters:
  • (string) content String to search for links in.
  • (string) target The target to add to the links.
  • (string[]) tags An array of tags to apply to.
Returns:
  • (string) The processed content.
Defined at:

Description

Adds a target attribute to all links in passed content.By default, this function only applies to `` tags. However, this can be modified via the `$tags` parameter. *NOTE:* Any current target attribute will be stripped and replaced.

Related Functions

_links_add_target, _links_add_base, links_add_base_url, link_pages, link_target_meta_box

Top Google Results

User discussions

wpseek mobile