@@ -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 |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | ], |
40 | 40 | ]; |
41 | 41 | |
42 | -add_action('customize_register', function ($wp_customize) use ($colors) { |
|
42 | +add_action('customize_register', function($wp_customize) use ($colors) { |
|
43 | 43 | $wp_customize->add_section( |
44 | 44 | 'theme_colors', |
45 | 45 | [ |
@@ -73,18 +73,18 @@ discard block |
||
73 | 73 | } |
74 | 74 | }); |
75 | 75 | |
76 | -add_action('customize_preview_init', function () { |
|
76 | +add_action('customize_preview_init', function() { |
|
77 | 77 | wp_enqueue_script( |
78 | 78 | 'customizer-colors', |
79 | 79 | Asset::requireUrl('assets/customizer-colors.js'), |
80 | - array('jquery','customize-preview'), |
|
80 | + array('jquery', 'customize-preview'), |
|
81 | 81 | '', |
82 | 82 | true |
83 | 83 | ); |
84 | 84 | }); |
85 | 85 | |
86 | -add_action('wp_head', function () use ($colors) { |
|
87 | - $hasChanged = array_filter($colors, function ($color, $name) { |
|
86 | +add_action('wp_head', function() use ($colors) { |
|
87 | + $hasChanged = array_filter($colors, function($color, $name) { |
|
88 | 88 | $value = get_theme_mod('theme_colors_' . $name, $color['default']); |
89 | 89 | return $value !== $color['default']; |
90 | 90 | }, ARRAY_FILTER_USE_BOTH); |