@@ -5,7 +5,7 @@ |
||
5 | 5 | use Flynt\FieldVariables; |
6 | 6 | use Flynt\Utils\Options; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=SliderImages', function ($data) { |
|
8 | +add_filter('Flynt/addComponentData?name=SliderImages', function($data) { |
|
9 | 9 | $translatableOptions = Options::getTranslatable('SliderOptions'); |
10 | 10 | $data['jsonData'] = [ |
11 | 11 | 'options' => array_merge($translatableOptions, $data['options']), |
@@ -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' => 'pageComponents', |
9 | 9 | 'title' => 'Page Components', |
@@ -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' => 'postComponents', |
9 | 9 | 'title' => 'Post Components', |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | return false; |
16 | 16 | } |
17 | 17 | |
18 | -add_filter('Flynt/addComponentData?name=FeatureGoogleAnalytics', function ($data) { |
|
18 | +add_filter('Flynt/addComponentData?name=FeatureGoogleAnalytics', function($data) { |
|
19 | 19 | $googleAnalyticsOptions = Options::getGlobal('GoogleAnalytics'); |
20 | 20 | |
21 | 21 | if ($googleAnalyticsOptions) { |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | return $data; |
32 | 32 | }); |
33 | 33 | |
34 | -add_action('Flynt/thirdPartyCookies/initializeOptions', function () { |
|
34 | +add_action('Flynt/thirdPartyCookies/initializeOptions', function() { |
|
35 | 35 | Options::addTranslatable('GoogleAnalytics', [ |
36 | 36 | [ |
37 | 37 | 'label' => 'Accept Google Analytics label', |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | ]); |
44 | 44 | }); |
45 | 45 | |
46 | -add_action('wp_footer', function () { |
|
46 | +add_action('wp_footer', function() { |
|
47 | 47 | $context = Timber::get_context(); |
48 | 48 | Timber::render_string('{{ renderComponent("FeatureGoogleAnalytics") }}', $context); |
49 | 49 | }); |
50 | 50 | |
51 | -add_filter('Flynt/thirdPartyCookies', function ($features) { |
|
51 | +add_filter('Flynt/thirdPartyCookies', function($features) { |
|
52 | 52 | $googleAnalyticsTranslatableOptions = Options::getTranslatable('GoogleAnalytics'); |
53 | 53 | |
54 | 54 | $features = array_merge($features, [ |
@@ -6,7 +6,7 @@ |
||
6 | 6 | use Flynt\FieldVariables; |
7 | 7 | use Timber\Timber; |
8 | 8 | |
9 | -add_action('wp_footer', function () { |
|
9 | +add_action('wp_footer', function() { |
|
10 | 10 | $context = Timber::get_context(); |
11 | 11 | Timber::render_string('{{ renderComponent("BlockCookieNotice") }}', $context); |
12 | 12 | }); |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | |
9 | 9 | const POST_TYPE = 'post'; |
10 | 10 | |
11 | -add_filter('Flynt/addComponentData?name=GridPostsLatest', function ($data) { |
|
11 | +add_filter('Flynt/addComponentData?name=GridPostsLatest', function($data) { |
|
12 | 12 | $postType = POST_TYPE; |
13 | 13 | |
14 | 14 | $data['taxonomies'] = $data['taxonomies'] ?: []; |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $data['items'] = Timber::get_posts([ |
17 | 17 | 'post_status' => 'publish', |
18 | 18 | 'post_type' => $postType, |
19 | - 'category' => join(',', array_map(function ($taxonomy) { |
|
19 | + 'category' => join(',', array_map(function($taxonomy) { |
|
20 | 20 | return $taxonomy->term_id; |
21 | 21 | }, $data['taxonomies'])), |
22 | 22 | 'posts_per_page' => $data['options']['columns'], |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | return $wpdb->prefix . TABLE_NAME; |
19 | 19 | } |
20 | 20 | |
21 | -call_user_func(function () { |
|
21 | +call_user_func(function() { |
|
22 | 22 | $optionName = TABLE_NAME . '_db_version'; |
23 | 23 | |
24 | 24 | $installedVersion = get_option($optionName); |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | return $uploadDir['relative']; |
48 | 48 | } |
49 | 49 | |
50 | -add_action('timber/twig/filters', function ($twig) { |
|
50 | +add_action('timber/twig/filters', function($twig) { |
|
51 | 51 | $twig->addFilter( |
52 | - new TwigFilter('resizeDynamic', function ( |
|
52 | + new TwigFilter('resizeDynamic', function( |
|
53 | 53 | $src, |
54 | 54 | $w, |
55 | 55 | $h = 0, |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | global $flyntResizedImages; |
75 | 75 | if (empty($flyntResizedImages)) { |
76 | - add_action('shutdown', function () { |
|
76 | + add_action('shutdown', function() { |
|
77 | 77 | storeResizedUrls(); |
78 | 78 | }, -1); |
79 | 79 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | add_rewrite_tag("%{$routeName}%", "([^&]+)"); |
101 | 101 | } |
102 | 102 | |
103 | -add_action('parse_request', function ($wp) { |
|
103 | +add_action('parse_request', function($wp) { |
|
104 | 104 | if (isset($wp->query_vars[IMAGE_ROUTE])) { |
105 | 105 | generateImage(); |
106 | 106 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | if ($localDev) { |
132 | 132 | $src = http_build_url($homeUrl, ['path' => $urlParts['path']]); |
133 | 133 | } |
134 | - $moveImageFunction = function ($location) use ($uploadDirRelative) { |
|
134 | + $moveImageFunction = function($location) use ($uploadDirRelative) { |
|
135 | 135 | return str_replace( |
136 | 136 | $uploadDirRelative, |
137 | 137 | trailingslashit($uploadDirRelative) . IMAGE_PATH_SEPARATOR, |
@@ -207,11 +207,11 @@ discard block |
||
207 | 207 | |
208 | 208 | add_filter('mod_rewrite_rules', 'Flynt\\TimberDynamicResize\\addRewriteRule'); |
209 | 209 | |
210 | -add_action('after_switch_theme', function () { |
|
210 | +add_action('after_switch_theme', function() { |
|
211 | 211 | add_action('shutdown', 'flush_rewrite_rules'); |
212 | 212 | }); |
213 | 213 | |
214 | -add_action('switch_theme', function () { |
|
214 | +add_action('switch_theme', function() { |
|
215 | 215 | remove_filter('mod_rewrite_rules', 'Flynt\\TimberDynamicResize\\addRewriteRule'); |
216 | 216 | flush_rewrite_rules(); |
217 | 217 | }); |
@@ -3,12 +3,12 @@ discard block |
||
3 | 3 | use Flynt\Utils\Asset; |
4 | 4 | use Flynt\Utils\ScriptLoader; |
5 | 5 | |
6 | -call_user_func(function () { |
|
6 | +call_user_func(function() { |
|
7 | 7 | $loader = new ScriptLoader(); |
8 | 8 | add_filter('script_loader_tag', [$loader, 'filterScriptLoaderTag'], 10, 2); |
9 | 9 | }); |
10 | 10 | |
11 | -add_action('wp_enqueue_scripts', function () { |
|
11 | +add_action('wp_enqueue_scripts', function() { |
|
12 | 12 | Asset::enqueue([ |
13 | 13 | 'name' => 'Flynt/assets', |
14 | 14 | 'path' => 'assets/main.js', |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | ]); |
23 | 23 | }); |
24 | 24 | |
25 | -add_action('admin_enqueue_scripts', function () { |
|
25 | +add_action('admin_enqueue_scripts', function() { |
|
26 | 26 | Asset::enqueue([ |
27 | 27 | 'name' => 'Flynt/assets/admin', |
28 | 28 | 'path' => 'assets/admin.js', |
@@ -22,12 +22,12 @@ |
||
22 | 22 | function setDocumentTitle() |
23 | 23 | { |
24 | 24 | // prevent yoast overwriting the title |
25 | - add_filter('pre_get_document_title', function ($title) { |
|
25 | + add_filter('pre_get_document_title', function($title) { |
|
26 | 26 | return ''; |
27 | 27 | }, 99); |
28 | 28 | |
29 | 29 | // set custom title and keep the default separator and site name |
30 | - add_filter('document_title_parts', function ($title) { |
|
30 | + add_filter('document_title_parts', function($title) { |
|
31 | 31 | $title['title'] = 'Base Style'; |
32 | 32 | return $title; |
33 | 33 | }, 99); |