@@ -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 | |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | use ACFComposer\ACFComposer; |
| 4 | 4 | use Flynt\Components; |
| 5 | 5 | |
| 6 | -add_action('Flynt/afterRegisterComponents', function () { |
|
| 6 | +add_action('Flynt/afterRegisterComponents', function() { |
|
| 7 | 7 | ACFComposer::registerFieldGroup([ |
| 8 | 8 | 'name' => 'reusableComponents', |
| 9 | 9 | 'title' => 'Reusable Components', |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | ]; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -add_filter('acf/prepare_field/name=reusablePost', function ($field) { |
|
| 28 | +add_filter('acf/prepare_field/name=reusablePost', function($field) { |
|
| 29 | 29 | // Set initial instructions and update with selected post link |
| 30 | 30 | $reusableAdminLink = admin_url('edit.php?post_type=reusable-component'); |
| 31 | 31 | $postEditLink = get_edit_post_link($field['value']); |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | use Timber\Timber; |
| 8 | 8 | use Timber\Post; |
| 9 | 9 | |
| 10 | -add_filter('Flynt/addComponentData?name=BlockAnchor', function ($data) { |
|
| 10 | +add_filter('Flynt/addComponentData?name=BlockAnchor', function($data) { |
|
| 11 | 11 | if (isset($data['anchor'])) { |
| 12 | 12 | // convert to lowercase letters only |
| 13 | 13 | $data['anchor'] = preg_replace('/[^a-zA-Z]/', '', strtolower($data['anchor'])); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | ]; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | -add_filter('acf/load_field/name=anchorLinkCopy', function ($field) { |
|
| 46 | +add_filter('acf/load_field/name=anchorLinkCopy', function($field) { |
|
| 47 | 47 | global $post; |
| 48 | 48 | $post = new \Timber\Post($post); |
| 49 | 49 | $message = $field['message']; |
@@ -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', |
@@ -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'), |