Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. // Allow the Gravity form to stay on the page when confirmation displays.
  2. add_filter( 'gform_pre_submission_filter', 'dw_show_confirmation_and_form' );
  3. function dw_show_confirmation_and_form( $form ) {
  4. $shortcode = '[gravityform id="' . $form['id'] . '" title="true" description="false"]';
  5.  
  6. if ( array_key_exists( 'confirmations', $form ) ) {
  7. foreach ( $form['confirmations'] as $key => $confirmation ) {
  8. $form['confirmations'][ $key ]['message'] = $shortcode . '<div class="confirmation-message">' . $form['confirmations'][ $key ]['message'] . '</div>';
  9. }
  10. }
  11.  
  12. return $form;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement