Support » Plugin: App Store Assistant » [Plugin: App Store Assistant] Added Affiliate standalone link functionality

  • Resolved pwlk


    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);

Viewing 1 replies (of 1 total)
  • Plugin Author SEALsystems


    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.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: App Store Assistant] Added Affiliate standalone link functionality’ is closed to new replies.