PluginProbe
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz / 2.12.8
SureForms – Contact Form Builder, AI Forms, Payment Form, Survey & Quiz v2.12.8
2.12.8 2.12.7 2.12.6 2.12.5 2.12.4 2.12.3 2.12.2 2.12.1 2.12.0 2.11.1 2.11.0 2.10.1 2.10.0 2.9.1 2.9.0 2.8.2 2.8.1 2.7.0 2.7.1 2.8.0 trunk 0.0.10 0.0.11 0.0.12 0.0.13 All 98 releases
← All changes | inc/updater-callbacks.php +22 -0 2.12.1 → 2.12.8 View file →
@@ -102,5 +102,27 @@
102 102
103 103 // update the options.
104 104 update_option( 'srfm_default_dynamic_block_option', $previous_options );
105 105 }
106 +
107 + /**
108 + * Clear Elementor's cached per-page asset list so pages built before the Payment
109 + * History widget declared its stylesheet dependency pick up the new head-loaded CSS.
110 + *
111 + * Elementor only recomputes `_elementor_page_assets` on document save, so without
112 + * this a page built with the widget in 2.12.2 keeps loading the CSS at render time
113 + * (footer → FOUC) after the update until it is re-saved in the editor. Dropping the
114 + * meta forces Elementor to regenerate it (including this dependency) on next render.
115 + *
116 + * @since 2.12.3
117 + * @return void
118 + */
119 + public static function clear_elementor_page_assets_cache() {
120 + // Deliberately NOT gated on class_exists( '\Elementor\Plugin' ). Updater::init()
121 + // writes the version marker unconditionally, so this callback runs exactly once —
122 + // and if Elementor happens not to be loaded in that particular request, the cache
123 + // would never be cleared and every pre-existing Elementor page would keep
124 + // footer-loading the CSS forever. delete_post_meta_by_key() is a harmless no-op on
125 + // sites that never used Elementor, so the guard bought nothing.
126 + delete_post_meta_by_key( '_elementor_page_assets' );
127 + }
106 128 }