@@ -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)) { |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | |
12 | 12 | define(__NAMESPACE__ . '\NS', __NAMESPACE__ . '\\'); |
13 | 13 | |
14 | -add_action('Flynt/afterRegisterComponents', function () { |
|
14 | +add_action('Flynt/afterRegisterComponents', function() { |
|
15 | 15 | if (((defined('WP_ENV') && WP_ENV === 'development') || current_user_can('editor') || current_user_can('administrator')) && isset($_GET['log'])) { |
16 | 16 | if (isset($_GET['component']) && !empty($_GET['component'])) { |
17 | 17 | define(__NAMESPACE__ . '\COMPONENT_WHITELIST', explode(',', $_GET['component'])); |
@@ -38,21 +38,21 @@ discard block |
||
38 | 38 | { |
39 | 39 | $type = gettype($data); |
40 | 40 | $output = json_encode($data); |
41 | - $result = "<script>console.log({$output});</script>\n"; |
|
41 | + $result = "<script>console.log({$output});</script>\n"; |
|
42 | 42 | echoDebug($result, $postpone); |
43 | 43 | } |
44 | 44 | |
45 | 45 | function consoleTable($data, $postpone = true) |
46 | 46 | { |
47 | 47 | $output = json_encode($data); |
48 | - $result = "<script>console.table({$output});</script>\n"; |
|
48 | + $result = "<script>console.table({$output});</script>\n"; |
|
49 | 49 | echoDebug($result, $postpone); |
50 | 50 | } |
51 | 51 | |
52 | 52 | function echoDebug($data, $postpone) |
53 | 53 | { |
54 | 54 | if ($postpone) { |
55 | - add_action('wp_footer', function () use ($data) { |
|
55 | + add_action('wp_footer', function() use ($data) { |
|
56 | 56 | echo $data; |
57 | 57 | }, 30); |
58 | 58 | } else { |
@@ -4,7 +4,7 @@ |
||
4 | 4 | * Add theme options to customizer |
5 | 5 | */ |
6 | 6 | |
7 | -add_action('customize_register', function ($wp_customize) { |
|
7 | +add_action('customize_register', function($wp_customize) { |
|
8 | 8 | // Add option to replace header logo |
9 | 9 | $wp_customize->add_setting( |
10 | 10 | 'custom_header_logo', |
@@ -23,7 +23,7 @@ |
||
23 | 23 | // This prevents unintended scrolling on pages with few content, when logged in. |
24 | 24 | add_theme_support('admin-bar', array('callback' => '__return_false')); |
25 | 25 | |
26 | -add_action('after_setup_theme', function () { |
|
26 | +add_action('after_setup_theme', function() { |
|
27 | 27 | /** |
28 | 28 | * Make theme available for translation. |
29 | 29 | * Translations can be filed in the /languages/ directory. |
@@ -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', 'flynt'), |
@@ -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, [ |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | |
75 | 75 | protected function addHooks() |
76 | 76 | { |
77 | - add_action('timber/twig/filters', function ($twig) { |
|
77 | + add_action('timber/twig/filters', function($twig) { |
|
78 | 78 | $twig->addFilter( |
79 | 79 | new TwigFilter('resizeDynamic', [$this, 'resizeDynamic']) |
80 | 80 | ); |
@@ -84,10 +84,10 @@ discard block |
||
84 | 84 | add_filter('mod_rewrite_rules', [$this, 'addWebpRewriteRule']); |
85 | 85 | } |
86 | 86 | if ($this->enabled || $this->webpEnabled) { |
87 | - add_action('after_switch_theme', function () { |
|
87 | + add_action('after_switch_theme', function() { |
|
88 | 88 | add_action('shutdown', 'flush_rewrite_rules'); |
89 | 89 | }); |
90 | - add_action('switch_theme', function () { |
|
90 | + add_action('switch_theme', function() { |
|
91 | 91 | flush_rewrite_rules(true); |
92 | 92 | }); |
93 | 93 | } |
@@ -336,7 +336,7 @@ discard block |
||
336 | 336 | remove_action('generate_rewrite_rules', [$this, 'registerRewriteRule']); |
337 | 337 | remove_action('parse_request', [$this, 'parseRequest']); |
338 | 338 | } |
339 | - add_action('shutdown', function () { |
|
339 | + add_action('shutdown', function() { |
|
340 | 340 | flush_rewrite_rules(false); |
341 | 341 | }); |
342 | 342 | } |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | } else { |
349 | 349 | remove_filter('mod_rewrite_rules', [$this, 'addWebpRewriteRule']); |
350 | 350 | } |
351 | - add_action('shutdown', function () { |
|
351 | + add_action('shutdown', function() { |
|
352 | 352 | require_once(ABSPATH . 'wp-admin/includes/file.php'); |
353 | 353 | WP_Filesystem(); |
354 | 354 | global $wp_filesystem; |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | |
360 | 360 | public function changeRelativeUploadPath($relativeUploadPath) |
361 | 361 | { |
362 | - add_action('shutdown', function () { |
|
362 | + add_action('shutdown', function() { |
|
363 | 363 | flush_rewrite_rules(false); |
364 | 364 | }); |
365 | 365 | } |
@@ -6,7 +6,7 @@ discard block |
||
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 | }); |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * Removes Gutenberg default styles on front-end |
16 | 16 | */ |
17 | -add_action('wp_print_styles', function () { |
|
17 | +add_action('wp_print_styles', function() { |
|
18 | 18 | wp_dequeue_style('wp-block-library'); |
19 | 19 | wp_dequeue_style('wp-block-library-theme'); |
20 | 20 | }); |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | use Flynt\Utils\TimberDynamicResize; |
7 | 7 | use acf_field_message; |
8 | 8 | |
9 | -add_action('acf/init', function () { |
|
9 | +add_action('acf/init', function() { |
|
10 | 10 | global $timberDynamicResize; |
11 | 11 | $timberDynamicResize = new TimberDynamicResize(); |
12 | 12 | }); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | add_filter( |
49 | 49 | 'acf/load_field/key=field_global_TimberDynamicResize_relativeUploadPath', |
50 | - function ($field) { |
|
50 | + function($field) { |
|
51 | 51 | $field['placeholder'] = TimberDynamicResize::getDefaultRelativeUploadDir(); |
52 | 52 | return $field; |
53 | 53 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | add_filter( |
57 | 57 | 'acf/load_field/key=field_global_TimberDynamicResize_webpSupport', |
58 | - function ($field) { |
|
58 | + function($field) { |
|
59 | 59 | if (!function_exists('imagewebp')) { |
60 | 60 | $messageField = new acf_field_message(); |
61 | 61 | $field = array_merge($messageField->defaults, $field); |
@@ -68,14 +68,14 @@ discard block |
||
68 | 68 | |
69 | 69 | add_filter( |
70 | 70 | 'acf/load_value/key=field_global_TimberDynamicResize_webpSupport', |
71 | - function ($value) { |
|
71 | + function($value) { |
|
72 | 72 | return function_exists('imagewebp') ? $value : '0'; |
73 | 73 | } |
74 | 74 | ); |
75 | 75 | |
76 | 76 | add_action( |
77 | 77 | 'update_option_options_global_TimberDynamicResize_dynamicImageGeneration', |
78 | - function ($oldValue, $value) { |
|
78 | + function($oldValue, $value) { |
|
79 | 79 | global $timberDynamicResize; |
80 | 80 | $timberDynamicResize->toggleDynamic($value === '1'); |
81 | 81 | }, |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | add_action( |
87 | 87 | 'update_option_options_global_TimberDynamicResize_webpSupport', |
88 | - function ($oldValue, $value) { |
|
88 | + function($oldValue, $value) { |
|
89 | 89 | global $timberDynamicResize; |
90 | 90 | $timberDynamicResize->toggleWebp($value === '1'); |
91 | 91 | }, |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | add_action( |
97 | 97 | 'update_option_options_global_TimberDynamicResize_relativeUploadPath', |
98 | - function ($oldValue, $value) { |
|
98 | + function($oldValue, $value) { |
|
99 | 99 | global $timberDynamicResize; |
100 | 100 | $timberDynamicResize->changeRelativeUploadPath($value); |
101 | 101 | }, |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | ); |
105 | 105 | |
106 | 106 | # WPML REWRITE FIX |
107 | -add_filter('mod_rewrite_rules', function ($rules) { |
|
107 | +add_filter('mod_rewrite_rules', function($rules) { |
|
108 | 108 | $homeRoot = parse_url(home_url()); |
109 | 109 | if (isset($homeRoot['path'])) { |
110 | 110 | $homeRoot = trailingslashit($homeRoot['path']); |
@@ -6,13 +6,13 @@ |
||
6 | 6 | use Timber\Menu; |
7 | 7 | use Flynt\Shortcodes; |
8 | 8 | |
9 | -add_action('init', function () { |
|
9 | +add_action('init', function() { |
|
10 | 10 | register_nav_menus([ |
11 | 11 | 'navigation_footer' => __('Navigation Footer', 'flynt') |
12 | 12 | ]); |
13 | 13 | }); |
14 | 14 | |
15 | -add_filter('Flynt/addComponentData?name=NavigationFooter', function ($data) { |
|
15 | +add_filter('Flynt/addComponentData?name=NavigationFooter', function($data) { |
|
16 | 16 | $data['maxLevel'] = 0; |
17 | 17 | $data['menu'] = new Menu('navigation_footer'); |
18 | 18 |