Advertisement
verygoodplugins

Untitled

Aug 27th, 2019
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1. function my_wpf_tags_filter( $apply_tags, $user_id, $contact_id, $form_id ) {
  2.  
  3.     wp_fusion()->logger->handle( 'info', $user_id, 'Tags into filter:', array( 'tag_array' => $apply_tags ) );
  4.  
  5.     foreach ( $apply_tags as $i => $tag ) {
  6.  
  7.         if ( $tag == 'Je peux recruter d\'autres volontaires' ) {
  8.  
  9.             $apply_tags[ $i ] = 'Recruiter';
  10.  
  11.         } elseif ( $tag == 'Je peux m\'impliquer dans des actions de campagne' ) {
  12.  
  13.             $apply_tags[ $i ] = 'Volunteer';
  14.  
  15.         } elseif ( $tag == 'Je peux passer des coups de fil' ) {
  16.  
  17.             $apply_tags[ $i ] = 'Caller';
  18.  
  19.         }
  20.  
  21.     }
  22.  
  23.     wp_fusion()->logger->handle( 'info', $user_id, 'Tags out of filter:', array( 'tag_array' => $apply_tags ) );
  24.  
  25.     return $apply_tags;
  26.  
  27. }
  28.  
  29. add_filter( 'wpf_forms_apply_tags', 'my_wpf_tags_filter', 10, 4 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement