PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / V3.0.2
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder vV3.0.2
V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 2.10.2 All 137 releases
bit-form / views / standalone-form.php

standalone-form.php in Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder V3.0.2, at views/standalone-form.php

105 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // This file is included via Render::view() using extract(); all variables below are in the calling method's local scope, not global namespace.
4
5 use BitCode\BitForm\Core\Util\EscapingHelper;
6
7 if (!defined('ABSPATH')) {
8 exit;
9 }
10 if (!defined('BITFORMS_ASSET_URI')) {
11 exit;
12 }
13
14 $formUpdateVersion = get_option('bitform_form_update_version');
15 $formIdSafe = sanitize_key((string) $formID);
16
17 $baseCSSPath = "/form-styles/bitform-{$formID}.css";
18 $customCSSPath = "/form-styles/bitform-custom-{$formID}.css";
19 $standaloneCSSPath = "/form-styles/bitform-standalone-{$formID}.css";
20
21 wp_register_style('bitform-standalone-base-' . $formIdSafe, BITFORMS_UPLOAD_BASE_URL . $baseCSSPath, [], $formUpdateVersion);
22 wp_enqueue_style('bitform-standalone-base-' . $formIdSafe);
23
24 if (file_exists(BITFORMS_CONTENT_DIR . $customCSSPath)) {
25 wp_register_style('bitform-standalone-custom-' . $formIdSafe, BITFORMS_UPLOAD_BASE_URL . $customCSSPath, [], $formUpdateVersion);
26 wp_enqueue_style('bitform-standalone-custom-' . $formIdSafe);
27 }
28
29 if (file_exists(BITFORMS_CONTENT_DIR . $standaloneCSSPath)) {
30 wp_register_style('bitform-standalone-extra-' . $formIdSafe, BITFORMS_UPLOAD_BASE_URL . $standaloneCSSPath, [], $formUpdateVersion);
31 wp_enqueue_style('bitform-standalone-extra-' . $formIdSafe);
32 }
33
34 if (isset($font) && '' !== $font) {
35 wp_register_style('bitform-standalone-font-' . $formIdSafe, $font, [], $formUpdateVersion);
36 wp_enqueue_style('bitform-standalone-font-' . $formIdSafe);
37 }
38
39 $previewJsPath = BITFORMS_UPLOAD_BASE_URL . '/form-scripts/preview-' . $formID . '.js';
40 wp_register_script('bitform-standalone-' . $formIdSafe, $previewJsPath, [], $formUpdateVersion, true);
41 wp_enqueue_script('bitform-standalone-' . $formIdSafe);
42 if (isset($bfGlobals) && '' !== $bfGlobals) {
43 wp_add_inline_script('bitform-standalone-' . $formIdSafe, (string) $bfGlobals, 'before');
44 }
45 ?>
46
47 <!DOCTYPE html>
48 <html lang="en">
49
50 <head>
51 <meta charset="UTF-8">
52 <meta http-equiv="X-UA-Compatible" content="IE=edge">
53 <meta name="viewport" content="width=device-width, initial-scale=1.0">
54 <title><?php echo isset($title) ? esc_html($title) : ''; ?></title>
55 <style>
56 * {
57 padding: 0;
58 margin: 0;
59 box-sizing: border-box;
60 }
61
62 .standalone-form-container {
63 min-height: 100vh;
64 display: flex;
65 justify-content: center;
66 align-items: center;
67 }
68
69 .standalone-form-wrapper {
70 width: 40%;
71 /* Additional styling for the container, if needed */
72 }
73
74 @media (max-width: 575.98px) {
75 .standalone-form-wrapper {
76 width: 100%;
77 }
78 }
79
80 ._frm-bg-b<?php echo esc_html($formID); ?> {
81 width: 100%;
82 }
83 </style>
84 <?php if (isset($font) && '' !== $font) : ?>
85 <link rel="preconnect" href="https://fonts.googleapis.com">
86 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
87 <?php endif; ?>
88 <?php
89 wp_enqueue_emoji_styles();
90 wp_print_styles();
91 ?>
92 </head>
93
94 <body>
95 <div class="standalone-form-container">
96 <div class="standalone-form-wrapper">
97 <?php echo wp_kses($formHTML, EscapingHelper::getFormAllowedHtml(isset($formContent) ? $formContent : null)); ?>
98 </div>
99 </div>
100
101 <?php wp_print_scripts(); ?>
102 </body>
103
104 </html>
105