/deprecated/includes/display/processing/filter-msgs.php

  1. <?php if ( ! defined( 'ABSPATH' ) ) exit; 
  2. add_action('init', 'ninja_forms_register_filter_msgs'); 
  3. function ninja_forms_register_filter_msgs() { 
  4. add_action( 'ninja_forms_post_process', 'ninja_forms_filter_msgs' ); 
  5.  
  6. function ninja_forms_filter_msgs() { 
  7. global $ninja_forms_processing; 
  8.  
  9. //Get the form settings for the form currently being processed. 
  10. $admin_subject = $ninja_forms_processing->get_form_setting( 'admin_subject' ); 
  11. $user_subject = $ninja_forms_processing->get_form_setting( 'user_subject' ); 
  12. $success_msg = $ninja_forms_processing->get_form_setting( 'success_msg' ); 
  13. $admin_email_msg = $ninja_forms_processing->get_form_setting( 'admin_email_msg' ); 
  14. $user_email_msg = $ninja_forms_processing->get_form_setting( 'user_email_msg' ); 
  15. $save_msg = $ninja_forms_processing->get_form_setting( 'save_msg' ); 
  16.  
  17. //Apply the wpautop to our fields if the email type is set to HTML 
  18. //$success_msg = wpautop( $success_msg ); 
  19. $save_msg = wpautop( $save_msg ); 
  20. if( $ninja_forms_processing->get_form_setting( 'email_type' ) == 'html' ) { 
  21. $admin_email_msg = wpautop( $admin_email_msg ); 
  22. $user_email_msg = wpautop( $user_email_msg ); 
  23.  
  24. //Apply shortcodes to each of our message fields. 
  25. $admin_subject = do_shortcode( $admin_subject ); 
  26. $user_subject = do_shortcode( $user_subject ); 
  27. //$success_msg = do_shortcode( $success_msg ); 
  28. $admin_email_msg = do_shortcode( $admin_email_msg ); 
  29. $user_email_msg = do_shortcode( $user_email_msg ); 
  30. $save_msg = do_shortcode( $save_msg ); 
  31.  
  32. //Call any functions which may be attached to the filter for our message fields 
  33. $ninja_forms_processing->update_form_setting('admin_subject', apply_filters('ninja_forms_admin_subject', $admin_subject)); 
  34. $ninja_forms_processing->update_form_setting('user_subject', apply_filters('ninja_forms_user_subject', $user_subject)); 
  35. //$ninja_forms_processing->update_form_setting('success_msg', apply_filters('ninja_forms_success_msg', $success_msg)); 
  36. $ninja_forms_processing->update_form_setting('admin_email_msg', apply_filters('ninja_forms_admin_email', $admin_email_msg)); 
  37. $ninja_forms_processing->update_form_setting('user_email_msg', apply_filters('ninja_forms_user_email', $user_email_msg)); 
  38. $ninja_forms_processing->update_form_setting('save_msg', apply_filters('ninja_forms_save_msg', $save_msg)); 
.