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.
  • (array) $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.

This function by default only applies to <a> tags, however this can be modified by the 3rd param.

NOTE: Any current target attributed 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