PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.10
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.10
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
← All changes | classes/controllers/FrmFormActionsController.php +43 -13 6.4.26.10 View file →
@@ -48,9 +48,9 @@
48 48 'email' => 'FrmEmailAction',
49 49 'wppost' => 'FrmDefPostAction',
50 50 'register' => 'FrmDefRegAction',
51 51 'paypal' => 'FrmDefPayPalAction',
52 - 'payment' => 'FrmDefHrsAction',
52 + 'payment' => 'FrmTransLiteAction',
53 53 'quiz' => 'FrmDefQuizAction',
54 54 'quiz_outcome' => 'FrmDefQuizOutcomeAction',
55 55 'mailchimp' => 'FrmDefMlcmpAction',
56 56 'api' => 'FrmDefApiAction',
@@ -240,9 +240,9 @@
240 240 $requires = FrmFormsHelper::get_plan_required( $upgrading );
241 241 if ( $requires && 'free' !== $requires ) {
242 242 $data['data-requires'] = $requires;
243 243 }
244 - }
244 + }//end if
245 245
246 246 // HTML to include on the icon.
247 247 $icon_atts = array();
248 248 if ( $action_control->action_options['color'] !== 'var(--primary-700)' ) {
@@ -253,8 +253,11 @@
253 253
254 254 include FrmAppHelper::plugin_path() . '/classes/views/frm-form-actions/_action_icon.php';
255 255 }
256 256
257 + /**
258 + * @param string $action
259 + */
257 260 public static function get_form_actions( $action = 'all' ) {
258 261 $temp_actions = self::$registered_actions;
259 262 if ( empty( $temp_actions ) ) {
260 263 self::actions_init();
@@ -265,9 +268,9 @@
265 268
266 269 $actions = array();
267 270
268 271 foreach ( $temp_actions as $a ) {
269 - if ( 'all' != $action && $a->id_base == $action ) {
272 + if ( 'all' !== $action && $a->id_base == $action ) {
270 273 return $a;
271 274 }
272 275
273 276 $actions[ $a->id_base ] = $a;
@@ -374,9 +377,9 @@
374 377 * @return bool
375 378 */
376 379 private static function should_show_log_message( $action_type ) {
377 380 $logging = array( 'api', 'salesforce', 'constantcontact', 'activecampaign' );
378 - return in_array( $action_type, $logging ) && ! function_exists( 'frm_log_autoloader' );
381 + return in_array( $action_type, $logging, true ) && ! function_exists( 'frm_log_autoloader' );
379 382 }
380 383
381 384 private static function fields_to_values( $form_id, array &$values ) {
382 385 $form = FrmForm::getOne( $form_id );
@@ -409,9 +412,22 @@
409 412 FrmAppHelper::permission_check( 'frm_edit_forms' );
410 413 $process_form = FrmAppHelper::get_post_param( 'process_form', '', 'sanitize_text_field' );
411 414 if ( ! wp_verify_nonce( $process_form, 'process_form_nonce' ) ) {
412 415 $frm_settings = FrmAppHelper::get_settings();
413 - wp_die( esc_html( $frm_settings->admin_permission ) );
416 + $error_args = array(
417 + 'title' => __( 'Verification failed', 'formidable' ),
418 + 'body' => $frm_settings->admin_permission,
419 + 'cancel_url' => add_query_arg(
420 + array(
421 + 'page' => 'formidable',
422 + 'frm_action' => 'settings',
423 + 'id' => $form_id,
424 + ),
425 + admin_url( 'admin.php?' )
426 + ),
427 + );
428 + FrmAppController::show_error_modal( $error_args );
429 + return;
414 430 }
415 431
416 432 global $wpdb;
417 433
@@ -486,9 +502,9 @@
486 502
487 503 $stored_actions = array();
488 504 $action_priority = array();
489 505
490 - if ( in_array( $event, array( 'create', 'update' ) ) && defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {
506 + if ( in_array( $event, array( 'create', 'update' ), true ) && defined( 'WP_IMPORTING' ) && WP_IMPORTING ) {
491 507 $this_event = 'import';
492 508 } else {
493 509 $this_event = $event;
494 510 }
@@ -529,9 +545,9 @@
529 545 $stored_actions[ $action->ID ] = $action;
530 546 $action_priority[ $action->ID ] = $link_settings[ $action->post_excerpt ]->action_options['priority'];
531 547
532 548 unset( $action );
533 - }
549 + }//end foreach
534 550
535 551 if ( ! empty( $stored_actions ) ) {
536 552 asort( $action_priority );
537 553
@@ -539,21 +555,35 @@
539 555 new FrmNotification();
540 556
541 557 foreach ( $action_priority as $action_id => $priority ) {
542 558 $action = $stored_actions[ $action_id ];
543 - do_action( 'frm_trigger_' . $action->post_excerpt . '_action', $action, $entry, $form, $event );
544 - do_action( 'frm_trigger_' . $action->post_excerpt . '_' . $event . '_action', $action, $entry, $form );
545 559
560 + /**
561 + * Allows custom form action trigger.
562 + *
563 + * @since 6.10
564 + *
565 + * @param bool $skip Skip default trigger.
566 + * @param object $action Action object.
567 + * @param object $entry Entry object.
568 + * @param object $form Form object.
569 + * @param string $event Event ('create' or 'update').
570 + */
571 + if ( false === apply_filters( 'frm_custom_trigger_action', false, $action, $entry, $form, $event ) ) {
572 + do_action( 'frm_trigger_' . $action->post_excerpt . '_action', $action, $entry, $form, $event );
573 + do_action( 'frm_trigger_' . $action->post_excerpt . '_' . $event . '_action', $action, $entry, $form );
574 + }
575 +
546 576 // If post is created, get updated $entry object.
547 - if ( $action->post_excerpt == 'wppost' && $event == 'create' ) {
577 + if ( $action->post_excerpt === 'wppost' && $event === 'create' ) {
548 578 $entry = FrmEntry::getOne( $entry->id, true );
549 579 }
550 - }
551 - }
580 + }//end foreach
581 + }//end if
552 582 }
553 583
554 584 public static function duplicate_form_actions( $form_id, $values, $args = array() ) {
555 - if ( ! isset( $args['old_id'] ) || empty( $args['old_id'] ) ) {
585 + if ( empty( $args['old_id'] ) ) {
556 586 // Continue if we know which actions to copy.
557 587 return;
558 588 }
559 589