Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function merge_affiliate_name( $update_data, $user_id, $contact_id, $form_id ) {
- if ( isset( $_COOKIE['affwp_ref'] ) ) {
- $affiliate = affwp_get_affiliate( $_COOKIE['affwp_ref'] );
- $userdata = get_userdata( $affiliate->user_id );
- $update_data['Field Name'] = $userdata->first_name . ' ' . $userdata->last_name;
- }
- return $update_data;
- }
- add_filter( 'wpf_forms_pre_submission', 'merge_affiliate_name', 10, 4 );
- function merge_affiliate_tags( $apply_tags, $user_id, $contact_id ) {
- if ( isset( $_COOKIE['affwp_ref'] ) ) {
- $apply_tags[] = 'Affiliate Tag';
- } else {
- $apply_tags[] = 'Not Affiliate';
- }
- return $apply_tags;
- }
- add_filter( 'wpf_forms_apply_tags', 'merge_affiliate_tags', 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement