wpseo_<rel>_rel_link

Filter: 'wpseo_' .

Description

apply_filters( 'wpseo_<rel>_rel_link', (string) $link_rel_esc_attr_rel_href_esc_url_url_n ); 

$rel . _rel_link - Allow changing link rel output by Yoast SEO

Parameters (1)

0. $link_rel_esc_attr_rel_href_esc_url_url_n — Optional. (string) => '\n"
The link rel esc attr rel href esc url url n.

Usage

To run the hook, copy the example below.
  1. $link_rel_esc_attr_rel_href_esc_url_url_n = apply_filters( 'wpseo_{$rel}_rel_link', $link_rel_esc_attr_rel_href_esc_url_url_n ); 
  2.  
  3. if ( !empty( $link_rel_esc_attr_rel_href_esc_url_url_n ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the wpseo_<rel>_rel_link callback 
  2. function filter_wpseo_rel_rel_link( $link_rel_esc_attr_rel_href_esc_url_url_n ) { 
  3. // make filter magic happen here... 
  4. return $link_rel_esc_attr_rel_href_esc_url_url_n
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( "wpseo_{$rel}_rel_link", 'filter_wpseo_rel_rel_link', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( "wpseo_{$rel}_rel_link", 'filter_wpseo_rel_rel_link', 10, 1 ); 

Defined (1)

The filter is defined in the following location(s).

/frontend/class-frontend.php  
  1. $link = apply_filters( 'wpseo_' . $rel . '_rel_link', '<link rel="' . esc_attr( $rel ) . '" href="' . esc_url( $url ) . "\" />\n" );