Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added mechanism to specify a constant for affiliate ID #483

Merged
merged 17 commits into from
May 2, 2014
Merged

Conversation

Japh
Copy link

@Japh Japh commented Apr 30, 2014

To be used in the Extensions page. Fixes #482.

* @return string A query string of the format '?ref=1', where 1 is the affiliate ID
*/
function get_affiliate() {
return ( defined( 'WP_STREAM_AFFILIATE_ID' ) ? '?ref=' . urlencode( WP_STREAM_AFFILIATE_ID ) : '' );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Japh Since the affiliate ID should always be a positive integer, I we should sanitized it this way:

return ( defined( 'WP_STREAM_AFFILIATE_ID' ) && is_int( WP_STREAM_AFFILIATE_ID ) ) ? sprintf( '?ref=%d', absint( WP_STREAM_AFFILIATE_ID ) ) : null;

@lukecarbis
Copy link
Contributor

Travis is happy, I'm happy. If everyone else is happy, let's merge.

@frankiejarrett
Copy link
Contributor

@lukecarbis Did you test and confirm that it works?

@lukecarbis
Copy link
Contributor

Yes - tested and works.

@frankiejarrett
Copy link
Contributor

👍

lukecarbis added a commit that referenced this pull request May 2, 2014
Added mechanism to specify a constant for affiliate ID
@lukecarbis lukecarbis merged commit 66ed62e into develop May 2, 2014
@lukecarbis lukecarbis deleted the issue-482 branch May 2, 2014 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider a mechanism for developers to set their affiliate ID on links from the Extensions page
7 participants