@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | // Convert ACF Field of type relationship to a Timber\Post and add all ACF Fields of that Post |
31 | 31 | add_filter('acf/format_value/type=relationship', NS . 'formatPostObject', 100); |
32 | -add_filter('get_twig', function ($twig) { |
|
32 | +add_filter('get_twig', function($twig) { |
|
33 | 33 | $twig->addExtension(new TwigExtensionFlynt()); |
34 | 34 | return $twig; |
35 | 35 | }); |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | function formatGallery($value) |
46 | 46 | { |
47 | 47 | if (!empty($value)) { |
48 | - $value = array_map(function ($image) { |
|
48 | + $value = array_map(function($image) { |
|
49 | 49 | return new Image($image); |
50 | 50 | }, $value); |
51 | 51 | } |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | return $value; |
71 | 71 | } |
72 | 72 | |
73 | -add_action('timber/twig/filters', function ($twig) { |
|
74 | - $twig->addFunction(new TwigFunction('placeholderImage', function ($width, $height, $color = null) { |
|
73 | +add_action('timber/twig/filters', function($twig) { |
|
74 | + $twig->addFunction(new TwigFunction('placeholderImage', function($width, $height, $color = null) { |
|
75 | 75 | $width = round($width); |
76 | 76 | $height = round($height); |
77 | 77 | $colorRect = $color ? "<rect width='{$width}' height='{$height}' style='fill:$color' />" : ''; |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | return "data:image/svg+xml;base64," . base64_encode($svg); |
80 | 80 | })); |
81 | 81 | |
82 | - $twig->addFunction(new TwigFunction('requireUrl', function ($asset) { |
|
82 | + $twig->addFunction(new TwigFunction('requireUrl', function($asset) { |
|
83 | 83 | return Asset::requireUrl($asset); |
84 | 84 | })); |
85 | 85 |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | use WP_Customize_Image_Control; |
10 | 10 | |
11 | -add_action('customize_register', function ($wp_customize) { |
|
11 | +add_action('customize_register', function($wp_customize) { |
|
12 | 12 | // Add option to replace header logo |
13 | 13 | $wp_customize->add_setting( |
14 | 14 | 'custom_header_logo', |
@@ -239,7 +239,7 @@ |
||
239 | 239 | |
240 | 240 | // Return default if no color provided |
241 | 241 | if (empty($color)) { |
242 | - return $default; |
|
242 | + return $default; |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | // Sanitize $color if "#" is provided |
@@ -136,10 +136,10 @@ discard block |
||
136 | 136 | ]; |
137 | 137 | } |
138 | 138 | |
139 | -add_action('acf/init', function () { |
|
139 | +add_action('acf/init', function() { |
|
140 | 140 | $options = Options::getGlobal('CustomizerColors'); |
141 | 141 | if ($options['enabled']) { |
142 | - add_action('customize_register', function ($wp_customize) { |
|
142 | + add_action('customize_register', function($wp_customize) { |
|
143 | 143 | $config = getConfig(); |
144 | 144 | $wp_customize->add_panel( |
145 | 145 | 'theme_colors_panel', |
@@ -185,17 +185,17 @@ discard block |
||
185 | 185 | } |
186 | 186 | }); |
187 | 187 | |
188 | - add_action('customize_preview_init', function () { |
|
188 | + add_action('customize_preview_init', function() { |
|
189 | 189 | wp_enqueue_script( |
190 | 190 | 'customizer-colors', |
191 | 191 | Asset::requireUrl('assets/customizer-colors.js'), |
192 | - array('jquery','customize-preview'), |
|
192 | + array('jquery', 'customize-preview'), |
|
193 | 193 | '', |
194 | 194 | true |
195 | 195 | ); |
196 | 196 | }); |
197 | 197 | |
198 | - add_action('wp_head', function () { |
|
198 | + add_action('wp_head', function() { |
|
199 | 199 | $config = getConfig(); |
200 | 200 | |
201 | 201 | $alphaColorAmount = 0.4; |
@@ -249,15 +249,15 @@ discard block |
||
249 | 249 | |
250 | 250 | // Check if color has 6 or 3 characters and get values |
251 | 251 | if (strlen($color) == 6) { |
252 | - $hex = array( $color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5] ); |
|
252 | + $hex = array($color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5]); |
|
253 | 253 | } elseif (strlen($color) == 3) { |
254 | - $hex = array( $color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2] ); |
|
254 | + $hex = array($color[0] . $color[0], $color[1] . $color[1], $color[2] . $color[2]); |
|
255 | 255 | } else { |
256 | 256 | return $default; |
257 | 257 | } |
258 | 258 | |
259 | 259 | // Convert hexadec to rgb |
260 | - $rgb = array_map('hexdec', $hex); |
|
260 | + $rgb = array_map('hexdec', $hex); |
|
261 | 261 | |
262 | 262 | // Check if opacity is set(rgba or rgb) |
263 | 263 | if ($opacity) { |