success.php
84 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Show success messages |
| 4 | * |
| 5 | * This template can be overridden by copying it to yourtheme/everest-forms/notices/success.php. |
| 6 | * |
| 7 | * HOWEVER, on occasion Everest Forms will need to update template files and you |
| 8 | * and you (the theme developer) will need to copy the new files to your theme to |
| 9 | * maintain compatibility. We try to do this as little as possible, but it does |
| 10 | * happen. When this occurs the version of the template file will be bumped and |
| 11 | * the readme will list any important changes. |
| 12 | * |
| 13 | * @see https://docs.everestforms.net/ |
| 14 | * @package EverestForms/Templates |
| 15 | * @version 1.0.0 |
| 16 | */ |
| 17 | |
| 18 | defined( 'ABSPATH' ) || exit; |
| 19 | |
| 20 | $classes = apply_filters( |
| 21 | 'everest_forms_success_notice_class', |
| 22 | array( |
| 23 | 'everest-forms-notice--success', |
| 24 | ) |
| 25 | ); |
| 26 | |
| 27 | global $__everest_form_id; |
| 28 | global $__everest_form_entry_id; |
| 29 | |
| 30 | ?> |
| 31 | |
| 32 | <?php if ( $messages ) : ?> |
| 33 | <?php foreach ( $messages as $message ) : ?> |
| 34 | <div class="everest-forms-notice <?php echo esc_attr( implode( ' ', $classes ) ); ?>" role="alert"> |
| 35 | <?php |
| 36 | echo wp_kses( |
| 37 | $message, |
| 38 | array( |
| 39 | 'div' => array( |
| 40 | 'class' => true, |
| 41 | 'style' => true, |
| 42 | ), |
| 43 | 'input' => array( |
| 44 | 'type' => true, |
| 45 | 'value' => true, |
| 46 | 'class' => true, |
| 47 | 'disabled' => true, |
| 48 | 'checked' => true, |
| 49 | ), |
| 50 | 'ul' => array( |
| 51 | 'class' => true, |
| 52 | ), |
| 53 | 'li' => array( |
| 54 | 'class' => true, |
| 55 | ), |
| 56 | ) |
| 57 | ); |
| 58 | |
| 59 | if ( ! empty( $__everest_form_id ) && ! empty( $__everest_form_entry_id ) ) { |
| 60 | $pdf_download_message = get_option( 'everest_forms_pdf_custom_download_text', '' ); |
| 61 | $form = json_decode( evf()->form->get( $__everest_form_id )->post_content, true ); |
| 62 | $pdf_submission = isset( $form['settings']['pdf_submission']['enable_pdf_submission'] ) && 0 !== $form['settings']['pdf_submission']['enable_pdf_submission'] ? $form['settings']['pdf_submission'] : ''; |
| 63 | |
| 64 | if ( isset( $pdf_submission['everest_forms_pdf_custom_download_text'] ) ) { |
| 65 | $pdf_download_message = $pdf_submission['everest_forms_pdf_custom_download_text']; |
| 66 | } |
| 67 | |
| 68 | if ( empty( $pdf_download_message ) ) { |
| 69 | $pdf_download_message = __( 'Download your form submission in PDF format', 'everest-forms' ); |
| 70 | } |
| 71 | |
| 72 | printf( |
| 73 | '%s%s%s', |
| 74 | '<br><small><a href="?page=evf-entries-pdf&form_id=' . esc_attr( $__everest_form_id ) . '&entry_id=' . esc_attr( $__everest_form_entry_id ) . '">', |
| 75 | esc_html( $pdf_download_message ), |
| 76 | '</a></small>' |
| 77 | ); |
| 78 | } |
| 79 | |
| 80 | ?> |
| 81 | </div> |
| 82 | <?php endforeach; ?> |
| 83 | <?php endif; ?> |
| 84 |