| @@ -67,9 +67,9 @@ | ||
| 67 | 67 | $data_message = __( 'Only show the fields you need and create branching forms. Upgrade to get conditional logic and question branching.', 'formidable' ); |
| 68 | 68 | $data_message .= ' <img src="' . esc_url( $images_url ) . '/survey-logic.png" srcset="' . esc_url( $images_url ) . 'survey-logic@2x.png 2x" alt="' . esc_attr__( 'Conditional Logic options', 'formidable' ) . '"/>'; |
| 69 | 69 | echo '<a href="javascript:void(0)" class="frm_noallow frm_show_upgrade frm_add_logic_link frm-collapsed frm-flex-justify" data-upgrade="' . esc_attr__( 'Conditional Logic options', 'formidable' ) . '" data-message="' . esc_attr( $data_message ) . '" data-medium="builder" data-content="logic">'; |
| 70 | 70 | esc_html_e( 'Conditional Logic', 'formidable' ); |
| 71 | - FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown8_icon', array( 'aria-hidden' => 'true' ) ); | |
| 71 | + FrmAppHelper::icon_by_class( 'frmfont frm_arrowdown6_icon', array( 'aria-hidden' => 'true' ) ); | |
| 72 | 72 | echo '</a>'; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
| @@ -434,14 +434,8 @@ | ||
| 434 | 434 | |
| 435 | 435 | // print_emoji_styles is deprecated. |
| 436 | 436 | remove_action( 'wp_print_styles', 'print_emoji_styles' ); |
| 437 | 437 | |
| 438 | - if ( FrmTestModeController::should_add_test_mode_container() ) { | |
| 439 | - do_action( 'frm_test_mode_init' ); | |
| 440 | - add_action( 'wp_enqueue_scripts', 'FrmTestModeController::register_and_enqueue_required_scripts' ); | |
| 441 | - add_filter( 'frm_filter_final_form', 'FrmTestModeController::maybe_add_test_mode_container', 99 ); | |
| 442 | - } | |
| 443 | - | |
| 444 | 438 | $include_theme = FrmAppHelper::get_param( 'theme', '', 'get', 'absint' ); |
| 445 | 439 | if ( $include_theme ) { |
| 446 | 440 | self::set_preview_query(); |
| 447 | 441 | self::load_theme_preview(); |
| @@ -1416,9 +1410,9 @@ | ||
| 1416 | 1410 | $sections = array( |
| 1417 | 1411 | 'advanced' => array( |
| 1418 | 1412 | 'name' => __( 'General', 'formidable' ), |
| 1419 | 1413 | 'title' => __( 'General Form Settings', 'formidable' ), |
| 1420 | - 'function' => array( self::class, 'advanced_settings' ), | |
| 1414 | + 'function' => array( __CLASS__, 'advanced_settings' ), | |
| 1421 | 1415 | 'icon' => 'frm_icon_font frm_settings_icon', |
| 1422 | 1416 | ), |
| 1423 | 1417 | 'email' => array( |
| 1424 | 1418 | 'name' => __( 'Actions & Notifications', 'formidable' ), |
| @@ -1448,9 +1442,9 @@ | ||
| 1448 | 1442 | ), |
| 1449 | 1443 | ), |
| 1450 | 1444 | 'buttons' => array( |
| 1451 | 1445 | 'name' => __( 'Buttons', 'formidable' ), |
| 1452 | - 'class' => self::class, | |
| 1446 | + 'class' => __CLASS__, | |
| 1453 | 1447 | 'function' => 'buttons_settings', |
| 1454 | 1448 | 'icon' => 'frm_icon_font frm_button_icon', |
| 1455 | 1449 | ), |
| 1456 | 1450 | 'landing' => array( |
| @@ -1486,9 +1480,9 @@ | ||
| 1486 | 1480 | ), |
| 1487 | 1481 | ), |
| 1488 | 1482 | 'html' => array( |
| 1489 | 1483 | 'name' => __( 'Customize HTML', 'formidable' ), |
| 1490 | - 'class' => self::class, | |
| 1484 | + 'class' => __CLASS__, | |
| 1491 | 1485 | 'function' => 'html_settings', |
| 1492 | 1486 | 'icon' => 'frm_icon_font frm_code_icon', |
| 1493 | 1487 | ), |
| 1494 | 1488 | ); |
| @@ -2055,32 +2049,12 @@ | ||
| 2055 | 2049 | // Get posted data |
| 2056 | 2050 | $form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' ); |
| 2057 | 2051 | $name = FrmAppHelper::get_post_param( 'form_name', '', 'sanitize_text_field' ); |
| 2058 | 2052 | |
| 2059 | - $form = FrmForm::getOne( $form_id ); | |
| 2060 | - if ( ! $form ) { | |
| 2061 | - wp_send_json_error( __( 'Form not found', 'formidable' ) ); | |
| 2062 | - } | |
| 2053 | + // Update the form name and form key. | |
| 2054 | + $form_key = FrmAppHelper::get_unique_key( sanitize_title( $name ), 'frm_forms', 'form_key' ); | |
| 2055 | + FrmForm::update( $form_id, compact( 'name', 'form_key' ) ); | |
| 2063 | 2056 | |
| 2064 | - if ( $name === $form->name ) { | |
| 2065 | - // Nothing to change so exit early. | |
| 2066 | - wp_send_json_success(); | |
| 2067 | - } | |
| 2068 | - | |
| 2069 | - $to_update = array( | |
| 2070 | - 'name' => $name, | |
| 2071 | - ); | |
| 2072 | - | |
| 2073 | - if ( '' !== $name ) { | |
| 2074 | - // Only update form_key if name is not empty. | |
| 2075 | - $form_key = FrmAppHelper::get_unique_key( sanitize_title( $name ), 'frm_forms', 'form_key' ); | |
| 2076 | - $to_update['form_key'] = $form_key; | |
| 2077 | - } else { | |
| 2078 | - $form_key = $form->form_key; | |
| 2079 | - } | |
| 2080 | - | |
| 2081 | - FrmForm::update( $form_id, $to_update ); | |
| 2082 | - | |
| 2083 | 2057 | wp_send_json_success( compact( 'form_key' ) ); |
| 2084 | 2058 | } |
| 2085 | 2059 | |
| 2086 | 2060 | public static function json_error( $errors ) { |
| @@ -3051,9 +3025,9 @@ | ||
| 3051 | 3025 | |
| 3052 | 3026 | $include_form_tag = apply_filters( 'frm_include_form_tag', true, $form ); |
| 3053 | 3027 | |
| 3054 | 3028 | $frm_settings = FrmAppHelper::get_settings(); |
| 3055 | - $submit = $form->options['submit_value'] ?? $frm_settings->submit_value; | |
| 3029 | + $submit = isset( $form->options['submit_value'] ) ? $form->options['submit_value'] : $frm_settings->submit_value; | |
| 3056 | 3030 | |
| 3057 | 3031 | global $frm_vars; |
| 3058 | 3032 | self::maybe_load_css( $form, $values['custom_style'], $frm_vars['load_css'] ); |
| 3059 | 3033 | |
| @@ -3141,12 +3115,12 @@ | ||
| 3141 | 3115 | * @return string |
| 3142 | 3116 | */ |
| 3143 | 3117 | private static function prepare_submit_message( $form, $entry_id, $args = array() ) { |
| 3144 | 3118 | $frm_settings = FrmAppHelper::get_settings( array( 'current_form' => $form->id ) ); |
| 3145 | - $opt = $args['success_opt'] ?? 'success'; | |
| 3119 | + $opt = isset( $args['success_opt'] ) ? $args['success_opt'] : 'success'; | |
| 3146 | 3120 | |
| 3147 | 3121 | if ( $entry_id && is_numeric( $entry_id ) ) { |
| 3148 | - $message = $form->options[ $opt . '_msg' ] ?? $frm_settings->success_msg; | |
| 3122 | + $message = isset( $form->options[ $opt . '_msg' ] ) ? $form->options[ $opt . '_msg' ] : $frm_settings->success_msg; | |
| 3149 | 3123 | $class = 'frm_message'; |
| 3150 | 3124 | } else { |
| 3151 | 3125 | $message = $frm_settings->failed_msg; |
| 3152 | 3126 | $class = FrmFormsHelper::form_error_class(); |