@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | acf_add_local_field_group($fieldGroup); |
86 | 86 | } |
87 | 87 | |
88 | - add_action('current_screen', function ($currentScreen) { |
|
88 | + add_action('current_screen', function($currentScreen) { |
|
89 | 89 | foreach (static::OPTION_TYPES as $optionType => $option) { |
90 | 90 | $isTranslatable = $option['translatable']; |
91 | 91 | $toplevelPageId = 'toplevel_page_' . $optionType; |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | add_filter('acf/settings/current_language', 'Flynt\Features\Acf\OptionPages::getDefaultAcfLanguage', 101); |
100 | 100 | |
101 | 101 | // hide language selector in admin bar |
102 | - add_action('wp_before_admin_bar_render', function () { |
|
102 | + add_action('wp_before_admin_bar_render', function() { |
|
103 | 103 | $adminBar = $GLOBALS['wp_admin_bar']; |
104 | 104 | $adminBar->remove_menu('WPML_ALS'); |
105 | 105 | }); |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | |
219 | 219 | protected static function prefixFields($fields, $prefix) |
220 | 220 | { |
221 | - return array_map(function ($field) use ($prefix) { |
|
221 | + return array_map(function($field) use ($prefix) { |
|
222 | 222 | $field['name'] = $prefix . '_' . $field['name']; |
223 | 223 | return $field; |
224 | 224 | }, $fields); |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | protected static function collectOptionsWithPrefix($options, $prefix) |
283 | 283 | { |
284 | 284 | $optionKeys = is_array($options) ? array_keys($options) : []; |
285 | - return array_reduce($optionKeys, function ($carry, $key) use ($options, $prefix) { |
|
285 | + return array_reduce($optionKeys, function($carry, $key) use ($options, $prefix) { |
|
286 | 286 | $count = 0; |
287 | 287 | $option = $options[$key]; |
288 | 288 | $key = str_replace($prefix, '', $key, $count); |
@@ -149,10 +149,10 @@ |
||
149 | 149 | } |
150 | 150 | if ($type === 'style') { |
151 | 151 | global $wp_styles; |
152 | - $repo =& $wp_styles; |
|
152 | + $repo = & $wp_styles; |
|
153 | 153 | } else { |
154 | 154 | global $wp_scripts; |
155 | - $repo =& $wp_scripts; |
|
155 | + $repo = & $wp_scripts; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | $asset = $repo->query($handle, 'registered'); |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | } |
14 | 14 | |
15 | 15 | // collect script dependencies |
16 | - $scriptDeps = array_reduce($dependencies, function ($list, $dependency) { |
|
16 | + $scriptDeps = array_reduce($dependencies, function($list, $dependency) { |
|
17 | 17 | if ($dependency['type'] === 'script') { |
18 | 18 | array_push($list, $dependency['name']); |
19 | 19 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | }, []); // jquery as a default dependency |
22 | 22 | |
23 | 23 | // collect style dependencies |
24 | - $styleDeps = array_reduce($dependencies, function ($list, $dependency) { |
|
24 | + $styleDeps = array_reduce($dependencies, function($list, $dependency) { |
|
25 | 25 | if ($dependency['type'] === 'style') { |
26 | 26 | array_push($list, $dependency['name']); |
27 | 27 | } |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | }, []); |
30 | 30 | |
31 | 31 | if (!empty($scriptDeps) || !empty($styleDeps)) { |
32 | - add_action('wp_enqueue_scripts', function () use ($scriptDeps, $styleDeps) { |
|
32 | + add_action('wp_enqueue_scripts', function() use ($scriptDeps, $styleDeps) { |
|
33 | 33 | Asset::addDependencies('Flynt/assets', $scriptDeps); |
34 | 34 | Asset::addDependencies('Flynt/assets', $styleDeps, 'style'); |
35 | 35 | }, 11); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | return $output; |
28 | 28 | } |
29 | 29 | |
30 | - // this action needs to be removed by the user if they want to overwrite this functionality |
|
30 | + // this action needs to be removed by the user if they want to overwrite this functionality |
|
31 | 31 | public static function loadFunctionsFile($componentName) |
32 | 32 | { |
33 | 33 | $componentManager = ComponentManager::getInstance(); |
@@ -48,13 +48,13 @@ |
||
48 | 48 | return ''; |
49 | 49 | } |
50 | 50 | |
51 | - $area = function ($areaName) use ($areaHtml) { |
|
51 | + $area = function($areaName) use ($areaHtml) { |
|
52 | 52 | if (array_key_exists($areaName, $areaHtml)) { |
53 | 53 | return $areaHtml[$areaName]; |
54 | 54 | } |
55 | 55 | }; |
56 | 56 | |
57 | - $data = function () use ($componentData) { |
|
57 | + $data = function() use ($componentData) { |
|
58 | 58 | $args = func_get_args(); |
59 | 59 | array_unshift($args, $componentData); |
60 | 60 | return Helpers::extractNestedDataFromArray($args); |
@@ -15,20 +15,20 @@ |
||
15 | 15 | return self::$instance; |
16 | 16 | } |
17 | 17 | |
18 | - /** |
|
19 | - * clone |
|
20 | - * |
|
21 | - * Prevent cloning with 'protected' keyword |
|
22 | - **/ |
|
18 | + /** |
|
19 | + * clone |
|
20 | + * |
|
21 | + * Prevent cloning with 'protected' keyword |
|
22 | + **/ |
|
23 | 23 | protected function __clone() |
24 | 24 | { |
25 | 25 | } |
26 | 26 | |
27 | - /** |
|
28 | - * constructor |
|
29 | - * |
|
30 | - * Prevent instantiation with 'protected' keyword |
|
31 | - **/ |
|
27 | + /** |
|
28 | + * constructor |
|
29 | + * |
|
30 | + * Prevent instantiation with 'protected' keyword |
|
31 | + **/ |
|
32 | 32 | protected function __construct() |
33 | 33 | { |
34 | 34 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | return is_null($output) ? '' : $output; |
45 | 45 | } |
46 | 46 | |
47 | -add_filter('Flynt/renderComponent', function ($output, $componentName, $data) { |
|
47 | +add_filter('Flynt/renderComponent', function($output, $componentName, $data) { |
|
48 | 48 | return apply_filters( |
49 | 49 | "Flynt/renderComponent?name={$componentName}", |
50 | 50 | $output, |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | ); |
54 | 54 | }, 10, 3); |
55 | 55 | |
56 | -add_filter('Flynt/addComponentData', function ($data, $componentName) { |
|
56 | +add_filter('Flynt/addComponentData', function($data, $componentName) { |
|
57 | 57 | return apply_filters( |
58 | 58 | "Flynt/addComponentData?name={$componentName}", |
59 | 59 | $data, |
@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | |
6 | 6 | define(__NAMESPACE__ . '\NS', __NAMESPACE__ . '\\'); |
7 | 7 | |
8 | -add_action('wp_enqueue_scripts', function () { |
|
8 | +add_action('wp_enqueue_scripts', function() { |
|
9 | 9 | if (is_user_logged_in()) { |
10 | 10 | Asset::register([ |
11 | 11 | 'type' => 'script', |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | wp_localize_script('Flynt/assets/auth', 'wpData', $data); |
21 | 21 | }); |
22 | 22 | |
23 | -add_action('wp_admin_enqueue_scripts', function () { |
|
23 | +add_action('wp_admin_enqueue_scripts', function() { |
|
24 | 24 | $data = [ |
25 | 25 | 'templateDirectoryUri' => get_template_directory_uri() . '/dist', |
26 | 26 | ]; |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | if (is_user_logged_in() || is_admin()) { |
32 | 32 | if (is_admin()) { |
33 | 33 | // add image to the flexible content component name |
34 | - add_filter('acf/fields/flexible_content/layout_title', function ($title, $field, $layout, $i) { |
|
34 | + add_filter('acf/fields/flexible_content/layout_title', function($title, $field, $layout, $i) { |
|
35 | 35 | $componentName = ucfirst($layout['name']); |
36 | 36 | $componentPath = "Components/{$componentName}"; |
37 | 37 | $componentPreviewDesktopPath = Asset::requirePath("{$componentPath}/preview-desktop.jpg"); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | }, 11, 4); |
48 | 48 | } else { |
49 | 49 | // adds Component Previews button to admin bar on front-end when logged in |
50 | - add_action('admin_bar_menu', function ($wpAdminBar) { |
|
50 | + add_action('admin_bar_menu', function($wpAdminBar) { |
|
51 | 51 | $title = __('Component Previews', 'flynt-starter-theme'); |
52 | 52 | $wpAdminBar->add_node([ |
53 | 53 | 'id' => 'toggleComponentPreviews', |
@@ -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 | }); |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | use Flynt\Utils\Asset; |
4 | 4 | |
5 | -add_action('wp_enqueue_scripts', function () { |
|
5 | +add_action('wp_enqueue_scripts', function() { |
|
6 | 6 | Asset::register([ |
7 | 7 | 'name' => 'console-polyfill', |
8 | 8 | 'type' => 'script', |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | }); |
63 | 63 | |
64 | -add_action('admin_enqueue_scripts', function () { |
|
64 | +add_action('admin_enqueue_scripts', function() { |
|
65 | 65 | Asset::enqueue([ |
66 | 66 | 'name' => 'Flynt/assets/admin', |
67 | 67 | 'path' => 'assets/admin.js', |