@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $b = hexdec(substr($color, 4, 2)); |
30 | 30 | } |
31 | 31 | |
32 | - $rgba = [ $r, $g, $b, $opacity ]; |
|
32 | + $rgba = [$r, $g, $b, $opacity]; |
|
33 | 33 | |
34 | 34 | if ($returnType === 'string') { |
35 | 35 | return 'rgba(' . implode(',', $rgba) . ')'; |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $s = round($s * 100, 1); |
86 | 86 | $l = round($l * 100, 1); |
87 | 87 | |
88 | - $hsla = [ $h, "$s%", "$l%", $opacity ]; |
|
88 | + $hsla = [$h, "$s%", "$l%", $opacity]; |
|
89 | 89 | |
90 | 90 | if ($returnType === 'string') { |
91 | 91 | return 'hsla(' . implode(',', $hsla) . ')'; |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Utils\Options; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=BlockPostFooter', function ($data) { |
|
7 | +add_filter('Flynt/addComponentData?name=BlockPostFooter', function($data) { |
|
8 | 8 | |
9 | 9 | return $data; |
10 | 10 | }); |
@@ -5,13 +5,13 @@ |
||
5 | 5 | use Timber; |
6 | 6 | use Flynt\Utils\Asset; |
7 | 7 | |
8 | -add_action('init', function () { |
|
8 | +add_action('init', function() { |
|
9 | 9 | register_nav_menus([ |
10 | 10 | 'navigation_burger' => __('Navigation Burger', 'flynt') |
11 | 11 | ]); |
12 | 12 | }); |
13 | 13 | |
14 | -add_filter('Flynt/addComponentData?name=NavigationBurger', function ($data) { |
|
14 | +add_filter('Flynt/addComponentData?name=NavigationBurger', function($data) { |
|
15 | 15 | $data['menu'] = new Timber\Menu('navigation_burger'); |
16 | 16 | $data['logo'] = [ |
17 | 17 | 'src' => get_theme_mod('custom_header_logo') ? get_theme_mod('custom_header_logo') : Asset::requireUrl('../assets/images/logo.svg'), |
@@ -5,13 +5,13 @@ |
||
5 | 5 | use Timber; |
6 | 6 | use Flynt\Utils\Asset; |
7 | 7 | |
8 | -add_action('init', function () { |
|
8 | +add_action('init', function() { |
|
9 | 9 | register_nav_menus([ |
10 | 10 | 'navigation_main' => __('Navigation Main', 'flynt') |
11 | 11 | ]); |
12 | 12 | }); |
13 | 13 | |
14 | -add_filter('Flynt/addComponentData?name=NavigationMain', function ($data) { |
|
14 | +add_filter('Flynt/addComponentData?name=NavigationMain', function($data) { |
|
15 | 15 | $data['menu'] = new Timber\Menu('navigation_main'); |
16 | 16 | $data['logo'] = [ |
17 | 17 | 'src' => get_theme_mod('custom_header_logo') ? get_theme_mod('custom_header_logo') : Asset::requireUrl('../assets/images/logo.svg'), |
@@ -11,17 +11,17 @@ discard block |
||
11 | 11 | use Flynt\Variables; |
12 | 12 | use Flynt\CSSVariables; |
13 | 13 | |
14 | -add_action('acf/init', function () { |
|
14 | +add_action('acf/init', function() { |
|
15 | 15 | $options = Options::getGlobal('Customizer'); |
16 | 16 | |
17 | 17 | if ($options['enabled']) { |
18 | - add_action('customize_register', function ($wp_customize) { |
|
18 | + add_action('customize_register', function($wp_customize) { |
|
19 | 19 | $wp_customize->register_control_type('Flynt\Customizer\Range\Control'); |
20 | 20 | $wp_customize->register_control_type('Flynt\Customizer\Typography\Control'); |
21 | 21 | addSettings($wp_customize); |
22 | 22 | }); |
23 | 23 | |
24 | - add_action('customize_controls_enqueue_scripts', function () { |
|
24 | + add_action('customize_controls_enqueue_scripts', function() { |
|
25 | 25 | wp_enqueue_script( |
26 | 26 | 'Flynt/customizerControls', |
27 | 27 | Asset::requireUrl('assets/customizerControls.js'), |
@@ -35,11 +35,11 @@ discard block |
||
35 | 35 | ); |
36 | 36 | }); |
37 | 37 | |
38 | - add_action('customize_preview_init', function () { |
|
38 | + add_action('customize_preview_init', function() { |
|
39 | 39 | wp_enqueue_script( |
40 | 40 | 'Flynt/customizerPreview', |
41 | 41 | Asset::requireUrl('assets/customizerPreview.js'), |
42 | - ['jquery','customize-preview'] |
|
42 | + ['jquery', 'customize-preview'] |
|
43 | 43 | ); |
44 | 44 | $fields = CSSVariables\getFields(); |
45 | 45 | wp_localize_script('Flynt/customizerPreview', 'FlyntCustomizerFields', $fields); |
@@ -61,7 +61,7 @@ |
||
61 | 61 | $json['default'] = $this->default ?? $this->setting->default; |
62 | 62 | $json['defaultKey'] = sanitize_title($json['default']['family']); |
63 | 63 | $json['fonts'] = $fonts; |
64 | - $json['variants'] = array_filter($fonts[$key]['variants'], function ($variant) { |
|
64 | + $json['variants'] = array_filter($fonts[$key]['variants'], function($variant) { |
|
65 | 65 | return strpos($variant, 'italic') === false; |
66 | 66 | }); |
67 | 67 | return $json; |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | use Flynt\Variables; |
10 | 10 | use Flynt\Utils\ColorHelpers; |
11 | 11 | |
12 | -add_action('wp_head', function () { |
|
12 | +add_action('wp_head', function() { |
|
13 | 13 | $variables = getCssVariables(); |
14 | 14 | ?> |
15 | 15 | <style type="text/css"> |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | return $fields; |
61 | 61 | } |
62 | 62 | |
63 | -add_filter('Flynt/cssVariable?type=color', function ($variable, $value, $field) { |
|
63 | +add_filter('Flynt/cssVariable?type=color', function($variable, $value, $field) { |
|
64 | 64 | if (isset($field['hsl'])) { |
65 | 65 | $colorHsla = ColorHelpers::hexToHsla($value); |
66 | 66 | $variable["{$field['name']}-h"] = $colorHsla[0]; |
@@ -71,14 +71,14 @@ discard block |
||
71 | 71 | return $variable; |
72 | 72 | }, 10, 3); |
73 | 73 | |
74 | -add_filter('Flynt/cssVariable?type=flynt-range', function ($variable, $value, $field) { |
|
74 | +add_filter('Flynt/cssVariable?type=flynt-range', function($variable, $value, $field) { |
|
75 | 75 | $unit = $field['unit'] ?? ''; |
76 | 76 | $variable[$field['name']] = $value . $unit; |
77 | 77 | |
78 | 78 | return $variable; |
79 | 79 | }, 10, 3); |
80 | 80 | |
81 | -add_filter('Flynt/cssVariable?type=flynt-typography', function ($variable, $value, $field) { |
|
81 | +add_filter('Flynt/cssVariable?type=flynt-typography', function($variable, $value, $field) { |
|
82 | 82 | $fontFamily = array_filter([ |
83 | 83 | $value['family'] ?? '', |
84 | 84 | $field['fallback'] ?? '', |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | use Flynt\Variables; |
10 | 10 | |
11 | -add_action('wp_enqueue_scripts', function () { |
|
11 | +add_action('wp_enqueue_scripts', function() { |
|
12 | 12 | $url = getFontsUrl(); |
13 | 13 | |
14 | 14 | if ($url) { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | } |
51 | 51 | |
52 | - return array_map(function ($setting) { |
|
52 | + return array_map(function($setting) { |
|
53 | 53 | return implode(',', array_values(array_unique($setting))); |
54 | 54 | }, $settings); |
55 | 55 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - return array_values(array_filter($fields, function ($field) { |
|
72 | + return array_values(array_filter($fields, function($field) { |
|
73 | 73 | return $field['type'] === 'flynt-typography'; |
74 | 74 | })); |
75 | 75 | } |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | use Flynt\Utils\Options; |
6 | 6 | use Flynt\Utils\TimberDynamicResize; |
7 | 7 | |
8 | -add_action('acf/init', function () { |
|
8 | +add_action('acf/init', function() { |
|
9 | 9 | global $timberDynamicResize; |
10 | 10 | $timberDynamicResize = new TimberDynamicResize(); |
11 | 11 | }); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | add_filter( |
40 | 40 | 'acf/load_field/key=field_global_TimberDynamicResize_relativeUploadPath', |
41 | - function ($field) { |
|
41 | + function($field) { |
|
42 | 42 | $field['placeholder'] = TimberDynamicResize::getDefaultRelativeUploadDir(); |
43 | 43 | return $field; |
44 | 44 | } |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | |
47 | 47 | add_action( |
48 | 48 | 'update_option_options_global_TimberDynamicResize_dynamicImageGeneration', |
49 | - function ($oldValue, $value) { |
|
49 | + function($oldValue, $value) { |
|
50 | 50 | global $timberDynamicResize; |
51 | 51 | $timberDynamicResize->toggleDynamic($value === '1'); |
52 | 52 | }, |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | add_action( |
58 | 58 | 'update_option_options_global_TimberDynamicResize_relativeUploadPath', |
59 | - function ($oldValue, $value) { |
|
59 | + function($oldValue, $value) { |
|
60 | 60 | global $timberDynamicResize; |
61 | 61 | $timberDynamicResize->changeRelativeUploadPath($value); |
62 | 62 | }, |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | ); |
66 | 66 | |
67 | 67 | # WPML REWRITE FIX |
68 | -add_filter('mod_rewrite_rules', function ($rules) { |
|
68 | +add_filter('mod_rewrite_rules', function($rules) { |
|
69 | 69 | $homeRoot = parse_url(home_url()); |
70 | 70 | if (isset($homeRoot['path'])) { |
71 | 71 | $homeRoot = trailingslashit($homeRoot['path']); |