App Store Assistant
[resolved] Added Affiliate standalone link functionality (2 posts)

  1. pwlk
    Posted 3 years ago #

    Wanted to share an addition I made to the plugin. Wanted to be able to reference the Affiliate link anywhere in a post.

    Using shortcode: [ios_app_affiliate id="12345678" text="App A"]
    Leaving text blank or out will default to app name.

    This is my post and it is about App A which I love so much

    Here's the updates

    <!-- appStore-main.php -->
    add_shortcode('ios_app_affiliate', 'appAffiliate_handler');
    function appAffiliate_handler( $atts,$content=null, $code="") {
    	// Get App ID and more_info_text from shortcode
    	extract( shortcode_atts( array(
    		'id' => '',
    		'text' => ''
    	), $atts ) );
    	//Don't do anything if the ID is blank or non-numeric
    	if($id == "" || !is_numeric($id))return;	
    	//Get the App Data
    	$app = appStore_get_data($id);
    	if($app) {
    		$appURL = getAffiliateURL($app->trackViewUrl);
    		if ($text == '') $text = $app->trackName;
    		$appURL = '<a href="'.$appURL.'">'.$text.'</a>';
    		return $appURL;
    	} else {
    		echo "";
    		//wp_die('No valid data for app id: ' . $id);


  2. SEALsystems
    Plugin Author

    Posted 3 years ago #

    Thanks, great idea. I have added it as two new shortcodes to version 4.6.

    [ios_app_link id="446277240" text="App Name"]
    [mac_app_link id="411372497" text="App Name"]

    I broke it up into two short codes incase Apple ever separates the handling of Mac Apps and iOS apps.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • App Store Assistant
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic