| @@ -43,14 +43,13 @@ | ||
| 43 | 43 | * @return void |
| 44 | 44 | */ |
| 45 | 45 | public static function register_actions() { |
| 46 | 46 | $action_classes = array( |
| 47 | - 'on_submit' => 'FrmOnSubmitAction', | |
| 48 | 47 | 'email' => 'FrmEmailAction', |
| 49 | 48 | 'wppost' => 'FrmDefPostAction', |
| 50 | 49 | 'register' => 'FrmDefRegAction', |
| 51 | 50 | 'paypal' => 'FrmDefPayPalAction', |
| 52 | - 'payment' => 'FrmTransLiteAction', | |
| 51 | + 'payment' => 'FrmDefHrsAction', | |
| 53 | 52 | 'quiz' => 'FrmDefQuizAction', |
| 54 | 53 | 'quiz_outcome' => 'FrmDefQuizOutcomeAction', |
| 55 | 54 | 'mailchimp' => 'FrmDefMlcmpAction', |
| 56 | 55 | 'api' => 'FrmDefApiAction', |
| @@ -244,11 +243,11 @@ | ||
| 244 | 243 | } |
| 245 | 244 | |
| 246 | 245 | // HTML to include on the icon. |
| 247 | 246 | $icon_atts = array(); |
| 248 | - if ( $action_control->action_options['color'] !== 'var(--primary-700)' ) { | |
| 247 | + if ( $action_control->action_options['color'] !== 'var(--primary-hover)' ) { | |
| 249 | 248 | $icon_atts = array( |
| 250 | - 'style' => '--primary-700:' . $action_control->action_options['color'], | |
| 249 | + 'style' => '--primary-hover:' . $action_control->action_options['color'], | |
| 251 | 250 | ); |
| 252 | 251 | } |
| 253 | 252 | |
| 254 | 253 | include FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/_action_icon.php'; |
| @@ -440,10 +439,8 @@ | ||
| 440 | 439 | } |
| 441 | 440 | $old_actions = array_diff( $old_actions, $new_actions ); |
| 442 | 441 | |
| 443 | 442 | self::delete_missing_actions( $old_actions ); |
| 444 | - | |
| 445 | - FrmOnSubmitHelper::save_on_submit_settings( $form_id ); | |
| 446 | 443 | } |
| 447 | 444 | |
| 448 | 445 | public static function delete_missing_actions( $old_actions ) { |
| 449 | 446 | if ( ! empty( $old_actions ) ) { |
| @@ -486,9 +483,9 @@ | ||
| 486 | 483 | |
| 487 | 484 | $stored_actions = array(); |
| 488 | 485 | $action_priority = array(); |
| 489 | 486 | |
| 490 | - if ( in_array( $event, array( 'create', 'update' ), true ) && defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { | |
| 487 | + if ( in_array( $event, array( 'create', 'update' ) ) && defined( 'WP_IMPORTING' ) && WP_IMPORTING ) { | |
| 491 | 488 | $this_event = 'import'; |
| 492 | 489 | } else { |
| 493 | 490 | $this_event = $event; |
| 494 | 491 | } |
| @@ -494,9 +491,9 @@ | ||
| 494 | 491 | } |
| 495 | 492 | |
| 496 | 493 | foreach ( $form_actions as $action ) { |
| 497 | 494 | |
| 498 | - $skip_this_action = ! in_array( $this_event, $action->post_content['event'], true ) || FrmOnSubmitAction::$slug === $action->post_excerpt; | |
| 495 | + $skip_this_action = ( ! in_array( $this_event, $action->post_content['event'] ) ); | |
| 499 | 496 | $skip_this_action = apply_filters( 'frm_skip_form_action', $skip_this_action, compact( 'action', 'entry', 'form', 'event' ) ); |
| 500 | 497 | if ( $skip_this_action ) { |
| 501 | 498 | continue; |
| 502 | 499 | } |
| @@ -504,9 +501,9 @@ | ||
| 504 | 501 | if ( ! is_object( $entry ) ) { |
| 505 | 502 | $entry = FrmEntry::getOne( $entry, true ); |
| 506 | 503 | } |
| 507 | 504 | |
| 508 | - if ( empty( $entry ) || ( FrmEntriesHelper::DRAFT_ENTRY_STATUS === (int) $entry->is_draft && 'draft' !== $event ) ) { | |
| 505 | + if ( empty( $entry ) || ( $entry->is_draft && $event != 'draft' ) ) { | |
| 509 | 506 | continue; |
| 510 | 507 | } |
| 511 | 508 | |
| 512 | 509 | $child_entry = ( ( is_object( $form ) && is_numeric( $form->parent_form_id ) && $form->parent_form_id ) || ( $entry && ( $entry->form_id != $form->id || $entry->parent_item_id ) ) || ( isset( $args['is_child'] ) && $args['is_child'] ) ); |
| @@ -543,9 +540,9 @@ | ||
| 543 | 540 | do_action( 'frm_trigger_' . $action->post_excerpt . '_action', $action, $entry, $form, $event ); |
| 544 | 541 | do_action( 'frm_trigger_' . $action->post_excerpt . '_' . $event . '_action', $action, $entry, $form ); |
| 545 | 542 | |
| 546 | 543 | // If post is created, get updated $entry object. |
| 547 | - if ( $action->post_excerpt === 'wppost' && $event === 'create' ) { | |
| 544 | + if ( $action->post_excerpt == 'wppost' && $event == 'create' ) { | |
| 548 | 545 | $entry = FrmEntry::getOne( $entry->id, true ); |
| 549 | 546 | } |
| 550 | 547 | } |
| 551 | 548 | } |
| @@ -551,9 +548,9 @@ | ||
| 551 | 548 | } |
| 552 | 549 | } |
| 553 | 550 | |
| 554 | 551 | public static function duplicate_form_actions( $form_id, $values, $args = array() ) { |
| 555 | - if ( empty( $args['old_id'] ) ) { | |
| 552 | + if ( ! isset( $args['old_id'] ) || empty( $args['old_id'] ) ) { | |
| 556 | 553 | // Continue if we know which actions to copy. |
| 557 | 554 | return; |
| 558 | 555 | } |
| 559 | 556 | |