PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.1
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.1
1.7.1 1.7.0 1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 All 51 releases
← All changes | app/Services/Theme/Readers/DiviSettingsReader.php +24 -1 1.6.6 → 1.7.1 View file →
@@ -32,11 +32,14 @@
32 32 * stylesheet paints the default — so it takes Divi's default here too. A
33 33 * value FluentCart cannot write (rgb(), rgba(), Divi 5's `hsl(from var(--gcid…))`
34 34 * or a `$variable(…)$` reference) is not stated.
35 35 *
36 + * Its Buttons → Border Radius (`all_buttons_border_radius`) is the button
37 + * radius (see radii()). Divi has no form-field or product-card radius setting.
38 + *
36 39 * Verified against Divi 5.0.1.
37 40 */
38 -class DiviSettingsReader implements ThemeSettingsReader
41 +class DiviSettingsReader implements ThemeSettingsReader, ThemeRadiusReader
39 42 {
40 43 /**
41 44 * Divi's defaults (GlobalData::$customizer_colors, the Customizer settings
42 45 * and the static stylesheet).
@@ -190,6 +193,26 @@
190 193
191 194 $raw = trim($raw);
192 195
193 196 return preg_match('/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/', $raw) ? strtolower(ColorMath::hex($raw)) : '';
197 + }
198 +
199 + /**
200 + * The button radius.
201 + *
202 + * `all_buttons_border_radius` is a whole number of px (sanitised with
203 + * `absint`, range 0–100), read exactly as Divi's customizer CSS reads it:
204 + * `absint( et_get_option( 'all_buttons_border_radius', '3' ) )`
205 + * (functions.php). Divi prints it when it is not 3; at 3 its stylesheet
206 + * paints the same 3px.
207 + *
208 + * @return array Role => length.
209 + */
210 + public static function radii(): array
211 + {
212 + if (!self::applies()) {
213 + return [];
214 + }
215 +
216 + return ['btn' => absint(et_get_option('all_buttons_border_radius', '3')) . 'px'];
194 217 }
195 218 }