| @@ -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', | 
| @@ -143,10 +143,10 @@ discard block | ||
| 143 | 143 | return $themes; | 
| 144 | 144 | } | 
| 145 | 145 | |
| 146 | -add_action('acf/init', function () { | |
| 146 | +add_action('acf/init', function() { | |
| 147 | 147 |      $options = Options::getGlobal('CustomizerColors'); | 
| 148 | 148 |      if ($options['enabled']) { | 
| 149 | -        add_action('customize_register', function ($wp_customize) { | |
| 149 | +        add_action('customize_register', function($wp_customize) { | |
| 150 | 150 | $themes = getThemesConfig(); | 
| 151 | 151 | |
| 152 | 152 | $wp_customize->add_panel( | 
| @@ -193,14 +193,14 @@ discard block | ||
| 193 | 193 | } | 
| 194 | 194 | }); | 
| 195 | 195 | |
| 196 | -        add_action('customize_preview_init', function () { | |
| 196 | +        add_action('customize_preview_init', function() { | |
| 197 | 197 | wp_enqueue_script( | 
| 198 | 198 | 'customizer-colors', | 
| 199 | 199 |                  Asset::requireUrl('assets/customizer-colors.js'), | 
| 200 | - ['jquery','customize-preview'], | |
| 200 | + ['jquery', 'customize-preview'], | |
| 201 | 201 | ); | 
| 202 | 202 | $themes = getThemesConfig(); | 
| 203 | -            $config = array_map(function ($theme) { | |
| 203 | +            $config = array_map(function($theme) { | |
| 204 | 204 | return $theme['colors']; | 
| 205 | 205 | }, $themes); | 
| 206 | 206 |              wp_localize_script('customizer-colors', 'FlyntCustomizerColorsData', $config); | 
| @@ -208,7 +208,7 @@ discard block | ||
| 208 | 208 | } | 
| 209 | 209 | }); | 
| 210 | 210 | |
| 211 | -add_action('wp_head', function () { | |
| 211 | +add_action('wp_head', function() { | |
| 212 | 212 | $themes = getThemesConfig(); | 
| 213 | 213 | ?> | 
| 214 | 214 | <style type="text/css"> | 
| @@ -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) . ')'; |