ninja_forms_filter_msgs

The Ninja Forms ninja forms filter msgs function.

Description

ninja_forms_filter_msgs(); 

Usage

  1. if ( !function_exists( 'ninja_forms_filter_msgs' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/display/processing/filter-msgs.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = ninja_forms_filter_msgs(); 
  7.  

Defined (1)

The function is defined in the following location(s).

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