• I would like to display a “pretty” i.e. shortened URL for my WP-Affiliate plugin. I realize this is not a plugin supported here, but since it a purely code related issue, I was hoping someone here had the answer. My existing string reads thus:

    foreach ($resultset as $resultset)
        {
        	if($resultset->creative_type =="0")
        	{
    			$separator='?';
    			$url=$resultset->ref_url;
    			if(strpos($url,'?')!==false) {
    				$separator='&';
    			}
        		$rel_tag = "";
    			if(WP_AFFILIATE_ENABLE_NOFOLLOW_IN_AFFILIATE_ADS === '1'){
    				$rel_tag = 'rel="nofollow"';
    			}
    		    if (empty($resultset->image)){// Text Link
    		        $aff_url = $resultset->ref_url.$separator."ap_id=".$_SESSION['user_id'];
    		        $code = "<a href=\"$aff_url\" target=\"blank\" $rel_tag>$resultset->link_text</a>";
    	            $banner = "<a href=\"$aff_url\" target=\"blank\">$resultset->link_text</a>";
    		    }

    which results in a URL ending in /ap_id=userid. I would like it to simply end in /userid. How do I change this? The Permalinks are set to post name currently.

  • The topic ‘Rewrite "pretty" URL for WP-Affiliate plugin’ is closed to new replies.