".esc_html($message)."
"; } ?>

Form id:

'; } ?>

403)); } $clonefrom = sanitize_text_field( wp_unslash( $_GET['clonefrom'] ) ); $forms_data = get_option('accua_forms_saved_forms', array()); if (isset($forms_data[$fid])){ $error .= '

' . esc_html__( 'Form already exists', 'contact-forms') . '

'; } elseif (empty($forms_data[$clonefrom])) { $error .= '

' . esc_html__( 'Source form doesn\'t exists.', 'contact-forms') . '

'; } else { $forms_data[$fid] = $forms_data[$clonefrom]; if (!isset($forms_data[$fid]['title'])) { $forms_data[$fid]['title'] = $clonefrom ." ".__( 'clone', 'contact-forms'); } else { $forms_data[$fid]['title'] .= " ". __( 'clone', 'contact-forms'); } update_option('accua_forms_saved_forms', $forms_data); } } return $error; } // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound -- Internal helper function, underscore prefix indicates private function _accua_forms_form_edit_action() { static $message = null; if ($message === null) { $message = ''; if (isset($_POST['accua-form-edit-action'])){ $post = stripslashes_deep($_POST); switch ($post['accua-form-edit-action']) { case 'delete': $fid = isset($post['form-id']) ? $post['form-id'] : ''; check_admin_referer('contact-forms-delete_'.$fid); $forms_data = get_option('accua_forms_saved_forms', array()); unset($forms_data[$fid]); update_option('accua_forms_saved_forms', $forms_data); $fid = esc_html($fid); // translators: %s is the form ID being deleted $message .= sprintf( __( 'Form "%s" deleted','contact-forms' ), $fid ); break; } } } return $message; } function accua_forms_validate_form_id($fid) { // Cast before the string checks below: a request that omits form-id // reaches here with null, and preg_match()/substr()/strlen() have // deprecated null arguments since PHP 8.1. An empty id fails the // pattern check anyway, which is the answer the callers want. $fid = (string) $fid; $error = ''; if (!preg_match('/^[a-z0-9_-]+$/i', $fid)) { $error .= "

".__( 'Only letters, numbers, hyphens, and underscores allowed in form identifier', 'contact-forms')."

"; } if (substr($fid,0,2) == '__') { $error .= "

".__( 'The identifier cannot start with two underscores (__)', 'contact-forms')."

"; } if (strlen($fid) > 70) { $error .= "

".__( 'The identifier cannot be longer than 70 characters', 'contact-forms')."

"; } return $error; } function accua_forms_list_page() { $message = ''; // phpcs:ignore WordPress.Security.NonceVerification.Missing -- Nonce verified below if (isset($_POST['accua-form-edit-action'])){ $message = _accua_forms_form_edit_action(); } elseif (isset($_GET['fid'])) { check_admin_referer('edit_posts'); $fid = sanitize_text_field(wp_unslash($_GET['fid'])); $error = accua_forms_validate_form_id($fid); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Nonce verified above if ($error === '' && (isset($_GET['clonefrom']) && $_GET['clonefrom'] !== '')) { $error .= _accua_forms_test_clonefrom($fid); } if ($error === '') { return accua_forms_edit_page($fid); } else { return accua_forms_add_page($error); } } ?>
".esc_html($message)."
"; } ?>


= 0) { ?>

get_var( $wpdb->prepare( "SELECT COUNT(*) FROM `{$wpdb->prefix}accua_forms_submissions` WHERE afs_form_id = %s AND afs_status >= 0", $fid ) ); $submissions_url = admin_url( 'admin.php?page=accua_forms_submissions_list&fid=' . urlencode( $fid ) ); printf( '%s (%s)', esc_url( $submissions_url ), esc_html__( 'Submissions', 'contact-forms' ), esc_html( number_format_i18n( $submission_count ) ) ); ?>

'__fieldset-begin', 'name' => __('Fieldset begin', 'contact-forms'), 'type' => 'fieldset-begin', 'description' => '', ); } elseif ($field['ref'] == '__fieldset-end') { $ref = array( 'id' => '__fieldset-end', 'name' => __('Fieldset end', 'contact-forms'), 'type' => 'fieldset-end', 'description' => '', ); } } } else { $ref = $avail_fields[$field['ref']]; if ( ! isset( $ref['id'] ) ) { $ref['id'] = $field['ref']; } if ( ! isset( $ref['name'] ) ) { $ref['name'] = $ref['label'] ?? $field['ref']; } } $form_fields_html .= accua_forms_field_text_settings_form($fid, $ref, $field); } foreach ($avail_fields as $avail_field_key => $avail_field) { if ( ! isset( $avail_field['id'] ) ) { $avail_field['id'] = $avail_field_key; } if ( ! isset( $avail_field['name'] ) ) { $avail_field['name'] = $avail_field['label'] ?? $avail_field_key; } $hidden = (empty($form_data['fields'][$avail_field['id']])) ? false : 'hidden'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output is pre-escaped in heredoc templates echo accua_forms_field_text_settings_form($fid, $avail_field, $hidden); } // Custom HTML field // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output is pre-escaped in heredoc templates echo accua_forms_field_text_settings_form($fid); // Fieldset begin // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output is pre-escaped in heredoc templates echo accua_forms_field_text_settings_form($fid, array( 'id' => '__fieldset-begin', 'name' => __( 'Fieldset begin', 'contact-forms'), 'type' => 'fieldset-begin', 'description' => __('You can use this field multiple times.', 'contact-forms'), 'default_value' => '', 'allowed_values' => '', )); // Fieldset end // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Output is pre-escaped in heredoc templates echo accua_forms_field_text_settings_form($fid, array( 'id' => '__fieldset-end', 'name' => __( 'Fieldset end', 'contact-forms'), 'type' => 'fieldset-end', 'description' => __('You can use this field multiple times.', 'contact-forms'), 'default_value' => '', 'allowed_values' => '', )); ?>


>

/>

/>
/>
/>
/>
/>
/>
/>
/>

/>
/>
/>
/>
/>
/>
/>

/>
/>
/>
/>
/>
/>
/>

Google Ads Conversion Tracking

true, 'editor_class' => 'accua_form_value', 'tinymce' => array( 'toolbar1' => 'fontselect,|,bold,italic,underline,|,bullist,numlist,|,link,unlink', 'font_formats' => $email_font_formats, 'content_style' => 'body { font-family: arial, helvetica, sans-serif; }', )); ?>


0, 'retention_unit' => 'months', 'retention_mode' => 'anonymize' ) ); $global_val = (int) $global_retention['retention_value']; $global_unit = $global_retention['retention_unit']; $global_mode = $global_retention['retention_mode']; $unit_labels = array( 'days' => __( 'days', 'contact-forms' ), 'months' => __( 'months', 'contact-forms' ), 'years' => __( 'years', 'contact-forms' ) ); $mode_labels = array( 'anonymize' => __( 'Anonymize', 'contact-forms' ), 'delete' => __( 'Delete permanently', 'contact-forms' ) ); if ( $global_val > 0 ) { $global_summary = sprintf( '%d %s: %s', $global_val, $unit_labels[ $global_unit ] ?? $global_unit, $mode_labels[ $global_mode ] ?? $global_mode ); } else { $global_summary = __( 'Keep indefinitely', 'contact-forms' ); } ?>