Em alguns programas de afiliados, como o Skimlinks, eles detectam links externos em seu blog usando um javascript na página que você precisa carregar em seu site.
Isso representa um problema porque o ThirstyAffiliates, quando combinado com o Autolinker, usará automaticamente o link de afiliado camuflado.
We created this snippet of code which tells the Autolinker to use the destination URL instead of the cloaked URL which means it’s now compatible with tools like Skimlinks.
function swapDestinationURLAutolinker($linkAttributes, $linkID) {
se (!is_admin()) {
$linkData = unserialize(get_post_meta($linkID, 'thirstyData', true));
$destinationUrl = htmlspecialchars_decode($linkData['linkurl'], ENT_COMPAT);
$linkAttributes['href'] = $destinationUrl;
}
return $linkAttributes;
}
add_filter('thirstyFilterLinkAttributesBeforeInsert', 'swapDestinationURLAutolinker', 10, 2);