Advertisement
verygoodplugins

Untitled

Jun 14th, 2019
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.58 KB | None | 0 0
  1. function add_coach_id_field( $meta_fields ) {
  2.  
  3.     $meta_fields['coach-id'] = array( 'label' => 'Coach ID', 'type' => 'text', 'group' => 'leadsource' );
  4.  
  5.     return $meta_fields;
  6.  
  7. }
  8.  
  9. add_filter( 'wpf_meta_fields', 'add_coach_id_field', 10 );
  10.  
  11. function set_coach_lead_source() {
  12.  
  13.     if( isset($_GET[ 'coach-id' ]) && isset( $contact_fields[ 'coach-id' ] ) && $contact_fields[ 'coach-id' ]['active'] == true ) {
  14.         setcookie( 'wpf_leadsource[coach-id]', $_GET[ 'coach-id' ], time() + DAY_IN_SECONDS * 90, COOKIEPATH, COOKIE_DOMAIN );
  15.     }
  16.  
  17. }
  18.  
  19. add_action( 'init', 'set_coach_lead_source' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement