| @@ -2,8 +2,9 @@ | ||
| 2 | 2 | |
| 3 | 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 | 4 | |
| 5 | 5 | use BitCode\BitForm\Core\Util\EscapingHelper; |
| 6 | +use BitCode\BitForm\Core\Util\FrontendHelpers; | |
| 6 | 7 | |
| 7 | 8 | if (!defined('ABSPATH')) { |
| 8 | 9 | exit; |
| 9 | 10 | } |
| @@ -13,10 +14,10 @@ | ||
| 13 | 14 | |
| 14 | 15 | $formUpdateVersion = get_option('bitform_form_update_version'); |
| 15 | 16 | $formIdSafe = sanitize_key((string) $formID); |
| 16 | 17 | |
| 17 | -$bitformCssUrl = BITFORMS_UPLOAD_BASE_URL . '/form-styles/bitform-' . $formID . '.css'; | |
| 18 | -$bitformFormIdCssUrl = BITFORMS_UPLOAD_BASE_URL . '/form-styles/bitform-' . $formID . '-formid.css'; | |
| 18 | +$bitformCssUrl = FrontendHelpers::styleSrc('form-styles/bitform-' . $formID . '.css'); | |
| 19 | +$bitformFormIdCssUrl = FrontendHelpers::styleSrc('form-styles/bitform-' . $formID . '-formid.css'); | |
| 19 | 20 | $customCssSubPath = "/form-styles/bitform-custom-{$formID}.css"; |
| 20 | 21 | |
| 21 | 22 | wp_register_style('bitform-entry-edit-base-' . $formIdSafe, $bitformCssUrl, [], $formUpdateVersion); |
| 22 | 23 | wp_register_style('bitform-entry-edit-formid-' . $formIdSafe, $bitformFormIdCssUrl, [], $formUpdateVersion); |
| @@ -23,9 +24,9 @@ | ||
| 23 | 24 | wp_enqueue_style('bitform-entry-edit-base-' . $formIdSafe); |
| 24 | 25 | wp_enqueue_style('bitform-entry-edit-formid-' . $formIdSafe); |
| 25 | 26 | |
| 26 | 27 | if (file_exists(BITFORMS_CONTENT_DIR . $customCssSubPath)) { |
| 27 | - wp_register_style('bitform-entry-edit-custom-' . $formIdSafe, BITFORMS_UPLOAD_BASE_URL . $customCssSubPath, [], $formUpdateVersion); | |
| 28 | + wp_register_style('bitform-entry-edit-custom-' . $formIdSafe, FrontendHelpers::styleSrc($customCssSubPath), [], $formUpdateVersion); | |
| 28 | 29 | wp_enqueue_style('bitform-entry-edit-custom-' . $formIdSafe); |
| 29 | 30 | } |
| 30 | 31 | |
| 31 | 32 | if (isset($font) && '' !== $font) { |
| @@ -78,8 +79,13 @@ | ||
| 78 | 79 | ?> |
| 79 | 80 | </head> |
| 80 | 81 | |
| 81 | 82 | <body> |
| 83 | + <?php | |
| 84 | + // Fallback config for when an optimizer defers or drops the inline script. | |
| 85 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- built by buildFormConfigTag(), JSON_HEX_* escaped. | |
| 86 | + echo isset($configTag) ? $configTag : ''; | |
| 87 | + ?> | |
| 82 | 88 | <?php echo wp_kses($formHTML, EscapingHelper::getFormAllowedHtml(isset($formContent) ? $formContent : null)); ?> |
| 83 | 89 | |
| 84 | 90 | <?php wp_print_scripts(); ?> |
| 85 | 91 | </body> |