Last active
August 29, 2015 14:06
-
-
Save ramiabraham/64c6aa8992954f4bc36f to your computer and use it in GitHub Desktop.
Affiliate ID shortcode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: AffiliateWP Affiliate ID Shortcode | |
| Plugin URI: http://affiliatewp.com | |
| Description: Adds a shortcode that displays the AffiliateWP affiliate id. | |
| Version: 0.1 | |
| Author: AffiliateWP | |
| Author URI: http://affiliatewp.com | |
| */ | |
| if ( class_exists( 'Affiliate_WP' ) ) { | |
| if ( ! function_exists('affwp_affiliate_id_shortcode') ) { | |
| function affwp_affiliate_id_shortcode() { | |
| if ( affwp_is_affiliate() ) { | |
| echo affwp_get_affiliate_id(); | |
| } else { | |
| echo 'This account is not yet an affiliate on this site.'; | |
| } | |
| } | |
| add_shortcode( 'affiliate_id' , 'affwp_affiliate_id_shortcode' ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment