Handle internal links in content
add_filter('wpuinternallinks__links', 'example_wpuinternallinks__links', 10, 1);
function example_wpuinternallinks__links($links) {
$links[] = array(
/* Limit to some locales */
'locales' => array('fr_FR'),
/* Add an attribute to the converted links */
'link_attributes' => 'target="_blank"',
/* Custom classname for converted links */
'link_classname' => 'my-internal-link',
/* Target link */
'url' => 'https://github.com'
/* 1 : direct string */
'string' => 'github',
/* or 2 : list of strings */
'strings' => array('github','git hub'),
);
return $links;
}
- Choose exact word ( no letter before or after )
- Add custom attributes to link.
- Handle uppercase letters.
- Choose target language.
- Custom layout on links ( class )
- Hook for default attributes.
- Select post types.
- Add multiple spellings.
- Admin page.
- Only on first link ?
- Disable on a post (admin).
- Apply on content/excerpt.
- Handle accents.