| @@ -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 | /** |
| @@ -305,9 +305,9 @@ | ||
| 305 | 305 | if ( self::is_too_long( $values ) ) { |
| 306 | 306 | $message .= '<br/> ' . sprintf( |
| 307 | 307 | /* translators: %1$s: Start link HTML, %2$s: end link HTML */ |
| 308 | 308 | __( 'However, your form is very long and may be %1$sreaching server limits%2$s.', 'formidable' ), |
| 309 | - '<a href="' . esc_url( self::get_form_too_long_docs_url() ) . '" target="_blank" rel="noopener">', | |
| 309 | + '<a href="https://formidableforms.com/knowledgebase/i-have-a-long-form-why-did-the-options-at-the-end-of-the-form-stop-saving/?utm_source=WordPress&utm_medium=builder&utm_campaign=liteplugin" target="_blank" rel="noopener">', | |
| 310 | 310 | '</a>' |
| 311 | 311 | ); |
| 312 | 312 | } |
| 313 | 313 | |
| @@ -318,21 +318,8 @@ | ||
| 318 | 318 | self::get_edit_vars( $id, array(), $message ); |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | /** |
| 322 | - * @since 6.25.1 | |
| 323 | - * | |
| 324 | - * @return string | |
| 325 | - */ | |
| 326 | - private static function get_form_too_long_docs_url() { | |
| 327 | - $utm = array( | |
| 328 | - 'campaign' => 'builder', | |
| 329 | - 'content' => 'form-too-long', | |
| 330 | - ); | |
| 331 | - return FrmAppHelper::admin_upgrade_link( $utm, 'knowledgebase/i-have-a-long-form-why-did-the-options-at-the-end-of-the-form-stop-saving/' ); | |
| 332 | - } | |
| 333 | - | |
| 334 | - /** | |
| 335 | 322 | * Remove the draft flag from any new fields from this current session. |
| 336 | 323 | * |
| 337 | 324 | * @since 6.8 |
| 338 | 325 | * |
| @@ -365,9 +352,8 @@ | ||
| 365 | 352 | * were likely not saved either. |
| 366 | 353 | * |
| 367 | 354 | * @since 3.06.01 |
| 368 | 355 | * |
| 369 | - * @param array $values | |
| 370 | 356 | * @return bool |
| 371 | 357 | */ |
| 372 | 358 | private static function is_too_long( $values ) { |
| 373 | 359 | return empty( $values['frm_end'] ); |
| @@ -448,14 +434,8 @@ | ||
| 448 | 434 | |
| 449 | 435 | // print_emoji_styles is deprecated. |
| 450 | 436 | remove_action( 'wp_print_styles', 'print_emoji_styles' ); |
| 451 | 437 | |
| 452 | - if ( FrmTestModeController::should_add_test_mode_container() ) { | |
| 453 | - do_action( 'frm_test_mode_init' ); | |
| 454 | - add_action( 'wp_enqueue_scripts', 'FrmTestModeController::register_and_enqueue_required_scripts' ); | |
| 455 | - add_filter( 'frm_filter_final_form', 'FrmTestModeController::maybe_add_test_mode_container', 99 ); | |
| 456 | - } | |
| 457 | - | |
| 458 | 438 | $include_theme = FrmAppHelper::get_param( 'theme', '', 'get', 'absint' ); |
| 459 | 439 | if ( $include_theme ) { |
| 460 | 440 | self::set_preview_query(); |
| 461 | 441 | self::load_theme_preview(); |
| @@ -1430,9 +1410,9 @@ | ||
| 1430 | 1410 | $sections = array( |
| 1431 | 1411 | 'advanced' => array( |
| 1432 | 1412 | 'name' => __( 'General', 'formidable' ), |
| 1433 | 1413 | 'title' => __( 'General Form Settings', 'formidable' ), |
| 1434 | - 'function' => array( self::class, 'advanced_settings' ), | |
| 1414 | + 'function' => array( __CLASS__, 'advanced_settings' ), | |
| 1435 | 1415 | 'icon' => 'frm_icon_font frm_settings_icon', |
| 1436 | 1416 | ), |
| 1437 | 1417 | 'email' => array( |
| 1438 | 1418 | 'name' => __( 'Actions & Notifications', 'formidable' ), |
| @@ -1462,9 +1442,9 @@ | ||
| 1462 | 1442 | ), |
| 1463 | 1443 | ), |
| 1464 | 1444 | 'buttons' => array( |
| 1465 | 1445 | 'name' => __( 'Buttons', 'formidable' ), |
| 1466 | - 'class' => self::class, | |
| 1446 | + 'class' => __CLASS__, | |
| 1467 | 1447 | 'function' => 'buttons_settings', |
| 1468 | 1448 | 'icon' => 'frm_icon_font frm_button_icon', |
| 1469 | 1449 | ), |
| 1470 | 1450 | 'landing' => array( |
| @@ -1500,9 +1480,9 @@ | ||
| 1500 | 1480 | ), |
| 1501 | 1481 | ), |
| 1502 | 1482 | 'html' => array( |
| 1503 | 1483 | 'name' => __( 'Customize HTML', 'formidable' ), |
| 1504 | - 'class' => self::class, | |
| 1484 | + 'class' => __CLASS__, | |
| 1505 | 1485 | 'function' => 'html_settings', |
| 1506 | 1486 | 'icon' => 'frm_icon_font frm_code_icon', |
| 1507 | 1487 | ), |
| 1508 | 1488 | ); |
| @@ -2069,32 +2049,12 @@ | ||
| 2069 | 2049 | // Get posted data |
| 2070 | 2050 | $form_id = FrmAppHelper::get_post_param( 'form_id', '', 'absint' ); |
| 2071 | 2051 | $name = FrmAppHelper::get_post_param( 'form_name', '', 'sanitize_text_field' ); |
| 2072 | 2052 | |
| 2073 | - $form = FrmForm::getOne( $form_id ); | |
| 2074 | - if ( ! $form ) { | |
| 2075 | - wp_send_json_error( __( 'Form not found', 'formidable' ) ); | |
| 2076 | - } | |
| 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' ) ); | |
| 2077 | 2056 | |
| 2078 | - if ( $name === $form->name ) { | |
| 2079 | - // Nothing to change so exit early. | |
| 2080 | - wp_send_json_success(); | |
| 2081 | - } | |
| 2082 | - | |
| 2083 | - $to_update = array( | |
| 2084 | - 'name' => $name, | |
| 2085 | - ); | |
| 2086 | - | |
| 2087 | - if ( '' !== $name ) { | |
| 2088 | - // Only update form_key if name is not empty. | |
| 2089 | - $form_key = FrmAppHelper::get_unique_key( sanitize_title( $name ), 'frm_forms', 'form_key' ); | |
| 2090 | - $to_update['form_key'] = $form_key; | |
| 2091 | - } else { | |
| 2092 | - $form_key = $form->form_key; | |
| 2093 | - } | |
| 2094 | - | |
| 2095 | - FrmForm::update( $form_id, $to_update ); | |
| 2096 | - | |
| 2097 | 2057 | wp_send_json_success( compact( 'form_key' ) ); |
| 2098 | 2058 | } |
| 2099 | 2059 | |
| 2100 | 2060 | public static function json_error( $errors ) { |
| @@ -3065,9 +3025,9 @@ | ||
| 3065 | 3025 | |
| 3066 | 3026 | $include_form_tag = apply_filters( 'frm_include_form_tag', true, $form ); |
| 3067 | 3027 | |
| 3068 | 3028 | $frm_settings = FrmAppHelper::get_settings(); |
| 3069 | - $submit = $form->options['submit_value'] ?? $frm_settings->submit_value; | |
| 3029 | + $submit = isset( $form->options['submit_value'] ) ? $form->options['submit_value'] : $frm_settings->submit_value; | |
| 3070 | 3030 | |
| 3071 | 3031 | global $frm_vars; |
| 3072 | 3032 | self::maybe_load_css( $form, $values['custom_style'], $frm_vars['load_css'] ); |
| 3073 | 3033 | |
| @@ -3155,12 +3115,12 @@ | ||
| 3155 | 3115 | * @return string |
| 3156 | 3116 | */ |
| 3157 | 3117 | private static function prepare_submit_message( $form, $entry_id, $args = array() ) { |
| 3158 | 3118 | $frm_settings = FrmAppHelper::get_settings( array( 'current_form' => $form->id ) ); |
| 3159 | - $opt = $args['success_opt'] ?? 'success'; | |
| 3119 | + $opt = isset( $args['success_opt'] ) ? $args['success_opt'] : 'success'; | |
| 3160 | 3120 | |
| 3161 | 3121 | if ( $entry_id && is_numeric( $entry_id ) ) { |
| 3162 | - $message = $form->options[ $opt . '_msg' ] ?? $frm_settings->success_msg; | |
| 3122 | + $message = isset( $form->options[ $opt . '_msg' ] ) ? $form->options[ $opt . '_msg' ] : $frm_settings->success_msg; | |
| 3163 | 3123 | $class = 'frm_message'; |
| 3164 | 3124 | } else { |
| 3165 | 3125 | $message = $frm_settings->failed_msg; |
| 3166 | 3126 | $class = FrmFormsHelper::form_error_class(); |