process-message.php 895 B

12345678910111213141516171819202122232425262728
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  2. /**
  3. * Outputs the HTML for the ajax processing div. Only used when submitting via ajax.
  4. *
  5. **/
  6. function ninja_forms_display_process_message($form_id){
  7. global $ninja_forms_processing_error, $ninja_forms_processing_response;
  8. $plugin_settings = nf_get_settings();
  9. $form_row = ninja_forms_get_form_by_id($form_id);
  10. $process_label = __( $plugin_settings['process_label'], 'ninja-forms' );
  11. if( isset( $form_row['data']['ajax'] ) ){
  12. $ajax = $form_row['data']['ajax'];
  13. }else{
  14. $ajax = 0;
  15. }
  16. if($ajax == 1){
  17. ?>
  18. <div id="ninja_forms_form_<?php echo $form_id;?>_process_msg" style="display:none;" class="ninja-forms-processing">
  19. <?php echo $process_label;?> <img src="<?php echo NINJA_FORMS_URL;?>/images/loading.gif" alt="loading">
  20. </div>
  21. <?php
  22. }
  23. }
  24. add_action( 'ninja_forms_display_before_form_wrap', 'ninja_forms_display_process_message' );