wp_targeted_link_rel
Filters the rel values that are added to links with target attribute.
Usage
add_filter( 'wp_targeted_link_rel', 'wp_kama_targeted_link_rel_filter', 10, 2 ); /** * Function for `wp_targeted_link_rel` filter-hook. * * @param string $rel The rel values. * @param string $link_html The matched content of the link tag including all HTML attributes. * * @return string */ function wp_kama_targeted_link_rel_filter( $rel, $link_html ){ // filter... return $rel; }
- $rel(string)
- The rel values.
- $link_html(string)
- The matched content of the link tag including all HTML attributes.
Changelog
Since 5.1.0 | Introduced. |
Where the hook is called
wp_targeted_link_rel
wp-includes/formatting.php 3366
$rel = apply_filters( 'wp_targeted_link_rel', 'noopener', $link_html );