Completed
Push — constructionplanless ( a84d3d...faea72 )
by Dominik
01:34
created
Features/Acf/OptionPages.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,6 @@
 block discarded – undo
13 13
 use Flynt\Features\AdminNotices\AdminNoticeManager;
14 14
 // use Flynt\Features\CustomPostTypes\CustomPostTypeRegister;
15 15
 use Flynt\Utils\Feature;
16
-use Flynt\Utils\FileLoader;
17 16
 use Flynt\Utils\StringHelpers;
18 17
 
19 18
 class OptionPages
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         self::createOptionPages();
72 72
 
73 73
         // Register Categories
74
-        add_action('acf/init', function () {
74
+        add_action('acf/init', function() {
75 75
             self::addComponentSubPages();
76 76
             self::addFeatureSubPages();
77 77
             // self::addCustomPostTypeSubPages();
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
     public static function addComponentData($data, $parentData, $config)
150 150
     {
151 151
         // get fields for this component
152
-        $options = array_reduce(array_keys(self::$optionTypes), function ($carry, $optionType) use ($config) {
152
+        $options = array_reduce(array_keys(self::$optionTypes), function($carry, $optionType) use ($config) {
153 153
             return array_merge($carry, self::get($optionType, 'Component', $config['name']));
154 154
         }, []);
155 155
 
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
             ];
218 218
         }
219 219
 
220
-        add_action('current_screen', function ($currentScreen) {
220
+        add_action('current_screen', function($currentScreen) {
221 221
             foreach (self::$optionTypes as $optionType => $option) {
222 222
                 $isTranslatable = $option['translatable'];
223 223
                 $toplevelPageId = 'toplevel_page_' . $optionType;
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
                     add_filter('acf/settings/current_language', 'Flynt\Features\Acf\OptionPages::getDefaultAcfLanguage', 101);
232 232
 
233 233
                     // hide language selector in admin bar
234
-                    add_action('wp_before_admin_bar_render', function () {
234
+                    add_action('wp_before_admin_bar_render', function() {
235 235
                         $adminBar = $GLOBALS['wp_admin_bar'];
236 236
                         $adminBar->remove_menu('WPML_ALS');
237 237
                     });
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 
330 330
     protected static function prefixFields($fields, $prefix)
331 331
     {
332
-        return array_map(function ($field) use ($prefix) {
332
+        return array_map(function($field) use ($prefix) {
333 333
             $field['name'] = $prefix . '_' . $field['name'];
334 334
             return $field;
335 335
         }, $fields);
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
     protected static function collectOptionsWithPrefix($options, $prefix)
394 394
     {
395 395
         $optionKeys = is_array($options) ? array_keys($options) : [];
396
-        return array_reduce($optionKeys, function ($carry, $key) use ($options, $prefix) {
396
+        return array_reduce($optionKeys, function($carry, $key) use ($options, $prefix) {
397 397
             $count = 0;
398 398
             $option = $options[$key];
399 399
             $key = str_replace($prefix, '', $key, $count);
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 
407 407
     protected static function combineArrayDefaults(array $array, array $defaults)
408 408
     {
409
-        return array_map(function ($value) use ($defaults) {
409
+        return array_map(function($value) use ($defaults) {
410 410
             return is_array($value) ? array_merge($defaults, $value) : [];
411 411
         }, $array);
412 412
     }
Please login to merge, or discard this patch.
inc/fieldGroups/pageComponents.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 use ACFComposer\ACFComposer;
4 4
 
5
-add_action('acf/init', function () {
5
+add_action('acf/init', function() {
6 6
     ACFComposer::registerFieldGroup([
7 7
         'name' => 'pageComponents',
8 8
         'title' => 'Page Components',
Please login to merge, or discard this patch.
inc/fieldGroups/postComponents.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 use ACFComposer\ACFComposer;
4 4
 
5
-add_action('acf/init', function () {
5
+add_action('acf/init', function() {
6 6
     ACFComposer::registerFieldGroup([
7 7
         'name' => 'postComponents',
8 8
         'title' => 'Post Components',
Please login to merge, or discard this patch.
inc/timber.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,11 +4,11 @@  discard block
 block discarded – undo
4 4
 use Flynt\Utils\Asset;
5 5
 use function Flynt\Features\TimberLoader\renderTwigIndex;
6 6
 
7
-add_filter('get_twig', function ($twig) {
7
+add_filter('get_twig', function($twig) {
8 8
     $twig->addFunction(new Twig_SimpleFunction('renderComponent', 'renderComponent'));
9 9
 
10
-    $twig->addFunction(new Twig_SimpleFunction('renderFlexibleContent', function ($fcField) {
11
-        return implode('', array_map(function ($field) {
10
+    $twig->addFunction(new Twig_SimpleFunction('renderFlexibleContent', function($fcField) {
11
+        return implode('', array_map(function($field) {
12 12
             return renderComponent(ucfirst($field['acf_fc_layout']), $field);
13 13
         }, $fcField));
14 14
     }));
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
     return $twig;
17 17
 });
18 18
 
19
-function renderComponent ($name, $data = [])
19
+function renderComponent($name, $data = [])
20 20
 {
21 21
     $data = apply_filters(
22 22
         'Flynt/addComponentData',
@@ -38,12 +38,12 @@  discard block
 block discarded – undo
38 38
     return renderTwigIndex(null, $name, $data, null);
39 39
 };
40 40
 
41
-add_action('after_setup_theme', function () {
41
+add_action('after_setup_theme', function() {
42 42
     new Timber\Timber();
43 43
 });
44 44
 
45
-add_action('Flynt/afterRegisterFeatures', function () {
46
-    add_action('wp_enqueue_scripts', function () {
45
+add_action('Flynt/afterRegisterFeatures', function() {
46
+    add_action('wp_enqueue_scripts', function() {
47 47
         Asset::register([
48 48
             'name' => 'console-polyfill',
49 49
             'type' => 'script',
Please login to merge, or discard this patch.