I am trying to create a shortcode that will return a link to a book on Amazon with a specific affiliate tracking code specific to the author. I created a user option called "amz" to hold the author's tracking code. This works fine when I'm using it elsewhere. This is the shortcode I created:
function amazon_link_function($atts, $content = null) {
extract(shortcode_atts(array(
'isbn' => ' ',
'title' => ' '
), $atts));
$amztrack = the_author_meta( 'amz' );
return '<a href="http://www.amazon.com/exec/obidos/ASIN/' .$isbn. '/' .$amztrack. '" title="' .$title. '" target="_blank">' .$title. '</a>';
} add_shortcode("amazon", "amazon_link_function");
The isbn and title values return properly, but the tracking code stored in the $amztrack variable is displayed as plain text before the paragraph the shortcode is used in:(
I also tired this for the return line and got the same result:
return '<a href="http://www.amazon.com/exec/obidos/ASIN/' .$isbn. '/' .the_author_meta( 'amz' ). '" title="' .$title. '" target="_blank">' .$title. '</a>';