{"id":3241,"date":"2015-10-20T10:49:51","date_gmt":"2015-10-20T00:49:51","guid":{"rendered":"https:\/\/thirstyaff.wpengine.com\/?post_type=knowledgebase&#038;p=3241"},"modified":"2024-04-16T13:27:47","modified_gmt":"2024-04-16T17:27:47","slug":"destination-url-cloaked-url-autolinker-skimlinks-compatibility","status":"publish","type":"ht_kb","link":"https:\/\/thirstyaffiliates.com\/pt\/docs\/destination-url-cloaked-url-autolinker-skimlinks-compatibility","title":{"rendered":"Como usar o URL de destino em vez do URL oculto com o Autolinker (compatibilidade com Skimlinks)"},"content":{"rendered":"<p>In some affiliate programs like Skimlinks, they detect external links on your blog by using an on-page javascript that you have to load on your site.<\/p>\n<p>This poses a problem because ThirstyAffiliates when paired with the Autolinker, will automatically use the cloaked affiliate link.<\/p>\n<p>We created this snippet of code which tells the Autolinker to use the destination URL instead of the cloaked URL which means it&#8217;s now compatible with tools like Skimlinks.<\/p>\n<pre>function swapDestinationURLAutolinker($linkAttributes, $linkID) {\r\n    if (!is_admin()) {\r\n        $linkData = unserialize(get_post_meta($linkID, 'thirstyData', true));\r\n        $destinationUrl = htmlspecialchars_decode($linkData['linkurl'], ENT_COMPAT);\r\n        $linkAttributes['href'] = $destinationUrl;\r\n    }\r\n\r\n    return $linkAttributes;\r\n}\r\n\r\nadd_filter('thirstyFilterLinkAttributesBeforeInsert', 'swapDestinationURLAutolinker', 10, 2);\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Em alguns programas de afiliados, como o Skimlinks, eles detectam links externos em seu blog usando um javascript na p\u00e1gina que precisa ser carregado em seu site. Isso representa um problema porque o ThirstyAffiliates, quando combinado com o Autolinker, usar\u00e1 automaticamente o link de afiliado camuflado. Criamos este trecho de c\u00f3digo<\/p>\n<p><a class=\"read-more\" href=\"https:\/\/thirstyaffiliates.com\/pt\/docs\/destination-url-cloaked-url-autolinker-skimlinks-compatibility\">Leia mais<\/a><\/p>","protected":false},"author":1,"comment_status":"open","ping_status":"closed","template":"","format":"standard","meta":{"_acf_changed":false,"om_disable_all_campaigns":false,"_strive_editorial_status":"not-started","_strive_copy_of":0,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"ht-kb-category":[498,495],"ht-kb-tag":[],"class_list":["post-3241","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-thirstyaffiliates-pro","ht_kb_category-how-tos-and-faqs"],"acf":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/thirstyaffiliates.com\/pt\/wp-json\/wp\/v2\/ht-kb\/3241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thirstyaffiliates.com\/pt\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/thirstyaffiliates.com\/pt\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/thirstyaffiliates.com\/pt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thirstyaffiliates.com\/pt\/wp-json\/wp\/v2\/comments?post=3241"}],"version-history":[{"count":0,"href":"https:\/\/thirstyaffiliates.com\/pt\/wp-json\/wp\/v2\/ht-kb\/3241\/revisions"}],"wp:attachment":[{"href":"https:\/\/thirstyaffiliates.com\/pt\/wp-json\/wp\/v2\/media?parent=3241"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/thirstyaffiliates.com\/pt\/wp-json\/wp\/v2\/ht-kb-category?post=3241"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/thirstyaffiliates.com\/pt\/wp-json\/wp\/v2\/ht-kb-tag?post=3241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}