| @@ -17,14 +17,15 @@ | ||
| 17 | 17 | $baseCSSPath = "/form-styles/bitform-{$formID}.css"; |
| 18 | 18 | $customCSSPath = "/form-styles/bitform-custom-{$formID}.css"; |
| 19 | 19 | $standaloneCSSPath = "/form-styles/bitform-standalone-{$formID}.css"; |
| 20 | 20 | |
| 21 | -wp_register_style('bitform-standalone-base-' . $formIdSafe, BITFORMS_UPLOAD_BASE_URL . $baseCSSPath, [], $formUpdateVersion); | |
| 22 | -wp_enqueue_style('bitform-standalone-base-' . $formIdSafe); | |
| 21 | +// Use the same handles as FrontendFormHandler::loadAssets() so WP dedups instead of printing the file twice. | |
| 22 | +wp_register_style('bitform-style-' . $formIdSafe, BITFORMS_UPLOAD_BASE_URL . $baseCSSPath, [], $formUpdateVersion); | |
| 23 | +wp_enqueue_style('bitform-style-' . $formIdSafe); | |
| 23 | 24 | |
| 24 | 25 | 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); | |
| 26 | + wp_register_style('bitform-style-custom-' . $formIdSafe, BITFORMS_UPLOAD_BASE_URL . $customCSSPath, [], $formUpdateVersion); | |
| 27 | + wp_enqueue_style('bitform-style-custom-' . $formIdSafe); | |
| 27 | 28 | } |
| 28 | 29 | |
| 29 | 30 | if (file_exists(BITFORMS_CONTENT_DIR . $standaloneCSSPath)) { |
| 30 | 31 | wp_register_style('bitform-standalone-extra-' . $formIdSafe, BITFORMS_UPLOAD_BASE_URL . $standaloneCSSPath, [], $formUpdateVersion); |
| @@ -93,8 +94,13 @@ | ||
| 93 | 94 | |
| 94 | 95 | <body> |
| 95 | 96 | <div class="standalone-form-container"> |
| 96 | 97 | <div class="standalone-form-wrapper"> |
| 98 | + <?php | |
| 99 | + // Fallback config for when an optimizer defers or drops the inline script. | |
| 100 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- built by buildFormConfigTag(), JSON_HEX_* escaped. | |
| 101 | + echo isset($configTag) ? $configTag : ''; | |
| 102 | + ?> | |
| 97 | 103 | <?php echo wp_kses($formHTML, EscapingHelper::getFormAllowedHtml(isset($formContent) ? $formContent : null)); ?> |
| 98 | 104 | </div> |
| 99 | 105 | </div> |
| 100 | 106 | |