PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.1.1
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.1.1
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
formidable / classes / models / FrmOnSubmitAction.php

FrmOnSubmitAction.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 6.1.1, at classes/models/FrmOnSubmitAction.php

66 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * On Submit form action
4 *
5 * @package Formidable
6 * @since 6.0
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 die( 'You are not allowed to call this page directly.' );
11 }
12
13 class FrmOnSubmitAction extends FrmFormAction {
14
15 public static $slug = 'on_submit';
16
17 public function __construct() {
18 $action_ops = array(
19 'classes' => 'frm_icon_font frm_checkmark_icon',
20 'active' => true,
21 'event' => array( 'create' ),
22 'limit' => 99,
23 'priority' => 9,
24 'color' => 'rgb(66, 193, 178)',
25 'keywords' => __( 'redirect, success, confirmation, submit', 'formidable' ),
26 );
27 $action_ops = apply_filters( 'frm_' . self::$slug . '_control_settings', $action_ops );
28
29 $this->maybe_save_edit_trigger( $action_ops );
30
31 parent::__construct( self::$slug, self::get_name(), $action_ops );
32 }
33
34 public static function get_name() {
35 return __( 'Confirmation', 'formidable' );
36 }
37
38 public function form( $instance, $args = array() ) {
39 include FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/on_submit_settings.php';
40 }
41
42 public function get_defaults() {
43 return array(
44 'success_action' => FrmOnSubmitHelper::get_default_action_type(),
45 'success_msg' => FrmOnSubmitHelper::get_default_msg(),
46 'show_form' => '',
47 'success_url' => '',
48 'success_page_id' => '',
49 );
50 }
51
52 /**
53 * Add a workaround in case Pro hasn't been updated. We don't want to
54 * lose the trigger and have edit messages start showing on create.
55 *
56 * @param array $action_ops The action setup details.
57 *
58 * @return void
59 */
60 protected function maybe_save_edit_trigger( &$action_ops ) {
61 if ( $action_ops['event'] === array( 'create' ) && FrmAppHelper::pro_is_installed() ) {
62 $action_ops['event'][] = 'update';
63 }
64 }
65 }
66