• Resolved phildsgn

    (@phildsgn)


    Hi there Josh,

    is there a way to add links programmatically on the fly? Let’s say I have a function attached to a hook in my functions.php, in which I want to automatically cloak links. Does ThirstyAffiliates provide a function in the means of
    add_new_link("http://some-external-url.com/some-article", "/recommends/your-affiliate-link")
    or something like that?

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @phildsgn,

    Thanks for the question. You might be able to call quickCreateAffiliateLink() which is an AJAX function the Quick Add Affiliate Link functionality uses. You can find this on line 1969 in thirstyaffiliates.php. But keep in mind the user will need appropriate access and it must be called via AJAX.

    Otherwise you can use that function as a model to roll your own function which calls wp_insert_post.

    Hope this helps!

    Cheers,
    Josh

    Thread Starter phildsgn

    (@phildsgn)

    Awesome! Thanks for the quick reply!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding links automatically’ is closed to new replies.