@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -add_action('after_setup_theme', function () { |
|
3 | +add_action('after_setup_theme', function() { |
|
4 | 4 | add_theme_support('title-tag'); |
5 | 5 | add_theme_support('post-thumbnails'); |
6 | 6 |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | { |
63 | 63 | add_filter('init', [$this, 'addRewriteTag']); |
64 | 64 | add_action('generate_rewrite_rules', [$this, 'registerRewriteRule']); |
65 | - add_action('parse_request', function ($wp) { |
|
65 | + add_action('parse_request', function($wp) { |
|
66 | 66 | if (isset($wp->query_vars[static::IMAGE_QUERY_VAR])) { |
67 | 67 | $this->checkAndGenerateImage($wp->query_vars[static::IMAGE_QUERY_VAR]); |
68 | 68 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | protected function addHooks() |
73 | 73 | { |
74 | - add_action('timber/twig/filters', function ($twig) { |
|
74 | + add_action('timber/twig/filters', function($twig) { |
|
75 | 75 | $twig->addFilter( |
76 | 76 | new TwigFilter('resizeDynamic', [$this, 'resizeDynamic']) |
77 | 77 | ); |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | add_filter('mod_rewrite_rules', [$this, 'addWebpRewriteRule']); |
82 | 82 | } |
83 | 83 | if ($this->enabled || $this->webpEnabled) { |
84 | - add_action('after_switch_theme', function () { |
|
84 | + add_action('after_switch_theme', function() { |
|
85 | 85 | add_action('shutdown', 'flush_rewrite_rules'); |
86 | 86 | }); |
87 | - add_action('switch_theme', function () { |
|
87 | + add_action('switch_theme', function() { |
|
88 | 88 | remove_filter('mod_rewrite_rules', [$this, 'addWebpRewriteRule']); |
89 | 89 | flush_rewrite_rules(); |
90 | 90 | }); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | $title .= '(' . self::getCallerFile(2) . '):'; |
70 | 70 | $type = gettype($data); |
71 | 71 | $output = json_encode($data); |
72 | - $result = "<script>console.{$logType}('{$title}', '({$type})', {$output});</script>\n"; |
|
72 | + $result = "<script>console.{$logType}('{$title}', '({$type})', {$output});</script>\n"; |
|
73 | 73 | self::echoDebug($result, $postpone); |
74 | 74 | } |
75 | 75 | } |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | protected static function echoDebug($data, $postpone) |
111 | 111 | { |
112 | 112 | if ($postpone) { |
113 | - add_action('wp_footer', function () use ($data) { |
|
113 | + add_action('wp_footer', function() use ($data) { |
|
114 | 114 | echo $data; |
115 | 115 | }, 30); |
116 | 116 | } else { |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | namespace Flynt\RemoveEditor; |
8 | 8 | |
9 | -add_action('init', function () { |
|
9 | +add_action('init', function() { |
|
10 | 10 | remove_post_type_support('page', 'editor'); |
11 | 11 | remove_post_type_support('post', 'editor'); |
12 | 12 | }); |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | namespace Flynt\HideProtectedPosts; |
8 | 8 | |
9 | -add_action('pre_get_posts', function ($query) { |
|
9 | +add_action('pre_get_posts', function($query) { |
|
10 | 10 | if (!$query->is_singular() && !is_admin()) { |
11 | 11 | $query->set('has_password', false); |
12 | 12 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | namespace Flynt\MimeTypes; |
8 | 8 | |
9 | -add_filter('upload_mimes', function ($mimes) { |
|
9 | +add_filter('upload_mimes', function($mimes) { |
|
10 | 10 | $mimes['svg'] = 'image/svg+xml'; |
11 | 11 | return $mimes; |
12 | 12 | }); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | } |
16 | 16 | } |
17 | 17 | |
18 | -add_filter('wp_insert_post_data', function ($data, $postArr) { |
|
18 | +add_filter('wp_insert_post_data', function($data, $postArr) { |
|
19 | 19 | if ( |
20 | 20 | in_array( |
21 | 21 | $postArr['post_type'], |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | return $data; |
38 | 38 | }, 99, 2); |
39 | 39 | |
40 | -add_shortcode('flyntTheContent', function ($attrs) { |
|
40 | +add_shortcode('flyntTheContent', function($attrs) { |
|
41 | 41 | $postId = $attrs['id']; |
42 | 42 | // in case the post id was not set correctly and is 0 |
43 | 43 | if (!empty($postId)) { |
@@ -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('Components/NavigationMain/Assets/logo.svg'), |
@@ -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 |