PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / V3.3.2
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder vV3.3.2
V3.3.2 3.3.1 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 All 139 releases
← All changes | includes/Core/Util/FrontendHelpers.php +26 -0 3.3.1 → V3.3.2 View file →
@@ -271,8 +271,34 @@
271 271 {
272 272 return array_unique(self::getAllFormIdsInPage());
273 273 }
274 274
275 + /**
276 + * URL of a generated stylesheet, carrying the form update version in the src.
277 + *
278 + * WP's own $ver argument is stripped by "remove query strings from static
279 + * resources" hardening (WP Ghost, optimizer snippets), which leaves a
280 + * regenerated stylesheet behind a CDN under its unchanged URL - the markup
281 + * then carries class names the cached CSS has never heard of. bfv rides
282 + * inside the src the way the generated JS bundle already does, so those
283 + * filters leave it alone. Falls back to the plugin version so the URL always
284 + * changes on upgrade, even where the option was never written.
285 + *
286 + * @param string $relativePath path under the bitforms upload dir, e.g. form-styles/bitform-15.css
287 + *
288 + * @return string
289 + */
290 + public static function styleSrc($relativePath)
291 + {
292 + $version = get_option('bitform_form_update_version');
293 + if (!$version) {
294 + $version = BITFORMS_VERSION;
295 + }
296 + $src = BITFORMS_UPLOAD_BASE_URL . '/' . ltrim((string) $relativePath, '/');
297 +
298 + return add_query_arg('bfv', rawurlencode((string) $version), $src);
299 + }
300 +
275 301 public static function hasMultipleForms()
276 302 {
277 303 $bfUniqFormIds = self::getAllFormIdsInPage();
278 304 self::checkIsPageBuilder($_SERVER);