Get custom affiliate slug from affiliate id in cookie as slicewp_aff
-
Hi, I need to get the actual affiliate custom slug from the current user’s cookie affiliate id in slicewp_aff to put it into a text field when the ?ref is not present anymore in the url (after site browsing or coming back few days later).
Obviously we have the premium licence.
Could you help me ?
I found this script on another topic…function slicewp_custom_add_gravity_forms_field_value_affiliate( $value ) { if ( ! function_exists( 'slicewp_get_referrer_affiliate_id' ) ) { return $value; } $affiliate = slicewp_get_affiliate( slicewp_get_referrer_affiliate_id() ); if ( is_null( $affiliate ) ) { return $value; } $user = get_userdata( $affiliate->get( 'user_id' ) ); $value = $user->user_login; // Value will be set to the user's username. return $value; } add_filter( 'gform_field_value_affiliate', 'slicewp_custom_add_gravity_forms_field_value_affiliate' );
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Get custom affiliate slug from affiliate id in cookie as slicewp_aff’ is closed to new replies.