| @@ -434,9 +434,9 @@ | ||
| 434 | 434 | |
| 435 | 435 | foreach ( $settings as $number => $new_instance ) { |
| 436 | 436 | $this->_set( $number ); |
| 437 | 437 | |
| 438 | - $old_instance = $all_instances[ $number ] ?? array(); | |
| 438 | + $old_instance = isset( $all_instances[ $number ] ) ? $all_instances[ $number ] : array(); | |
| 439 | 439 | |
| 440 | 440 | if ( ! isset( $new_instance['post_status'] ) ) { |
| 441 | 441 | $new_instance['post_status'] = 'draft'; |
| 442 | 442 | } |
| @@ -451,9 +451,9 @@ | ||
| 451 | 451 | |
| 452 | 452 | $new_instance['post_type'] = FrmFormActionsController::$action_post_type; |
| 453 | 453 | $new_instance['post_name'] = $this->form_id . '_' . $this->id_base . '_' . $this->number; |
| 454 | 454 | $new_instance['menu_order'] = $this->form_id; |
| 455 | - $new_instance['post_date'] = $old_instance->post_date ?? ''; | |
| 455 | + $new_instance['post_date'] = isset( $old_instance->post_date ) ? $old_instance->post_date : ''; | |
| 456 | 456 | $instance = $this->update( $new_instance, $old_instance ); |
| 457 | 457 | |
| 458 | 458 | /** |
| 459 | 459 | * Filter an action's settings before saving. |
| @@ -539,11 +539,8 @@ | ||
| 539 | 539 | return array(); |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | if ( 'all' !== $type ) { |
| 543 | - if ( is_array( $action_controls ) ) { | |
| 544 | - return array(); | |
| 545 | - } | |
| 546 | 543 | return $action_controls->get_all( $form_id, $atts ); |
| 547 | 544 | } |
| 548 | 545 | |
| 549 | 546 | self::prepare_get_action( $atts ); |
| @@ -867,8 +864,34 @@ | ||
| 867 | 864 | } |
| 868 | 865 | |
| 869 | 866 | $stop = false; |
| 870 | 867 | return $stop; |
| 868 | + } | |
| 869 | + | |
| 870 | + /** | |
| 871 | + * Prepare the logic value for comparison against the entered value | |
| 872 | + * | |
| 873 | + * @since 2.01.02 | |
| 874 | + * | |
| 875 | + * @param array|string $logic_value | |
| 876 | + * | |
| 877 | + * @return void | |
| 878 | + */ | |
| 879 | + private static function prepare_logic_value( &$logic_value, $action, $entry ) { | |
| 880 | + if ( is_array( $logic_value ) ) { | |
| 881 | + $logic_value = reset( $logic_value ); | |
| 882 | + } | |
| 883 | + | |
| 884 | + if ( $logic_value === 'current_user' ) { | |
| 885 | + $logic_value = get_current_user_id(); | |
| 886 | + } | |
| 887 | + | |
| 888 | + $logic_value = apply_filters( 'frm_content', $logic_value, $action->menu_order, $entry ); | |
| 889 | + | |
| 890 | + /** | |
| 891 | + * @since 4.04.05 | |
| 892 | + */ | |
| 893 | + $logic_value = apply_filters( 'frm_action_logic_value', $logic_value ); | |
| 871 | 894 | } |
| 872 | 895 | |
| 873 | 896 | /** |
| 874 | 897 | * Get the value from a specific field and entry |