appending affiliate ID to the end of a link via a WP shortcode

by phetus
1 replies
I have the plugin "Allow PHP in Posts and Pages" installed on a website. I'm looking for a way set up a piece of code that will allow me to wrap a bare link that I post in the regular post editor with a shortcode that in turn appends my affiliate ID to the end and create an image link. Basically, this:

[link]http://www.affiliatelink.com/item[/link]

turns into:

<a href="http://www.affiliatelink.com/item&aid=1234"><img src="http://www.mywebsite.com/checkprice.jpg"></a>

How would I go about setting up the PHP in order to use the link between the shortcode tags as a variable in another piece of code?
#affiliate #appending #end #link #shortcode
  • Profile picture of the author Blakos
    I think you are confusing yourself with BBCode...
    {{ DiscussionBoard.errors[8232055].message }}

Trending Topics