@@ -34,11 +34,11 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public static function indexedValuesToAssocKeys(array $array) |
| 36 | 36 | { |
| 37 | - $values = array_map(function ($value) { |
|
| 37 | + $values = array_map(function($value) { |
|
| 38 | 38 | return is_array($value) ? $value : []; |
| 39 | 39 | }, $array); |
| 40 | 40 | |
| 41 | - $keys = array_map(function ($key) use ($array) { |
|
| 41 | + $keys = array_map(function($key) use ($array) { |
|
| 42 | 42 | return is_int($key) ? $array[$key] : $key; |
| 43 | 43 | }, array_keys($array)); |
| 44 | 44 | |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | { |
| 7 | 7 | public static function setTemplateDirectory() |
| 8 | 8 | { |
| 9 | - add_action('after_switch_theme', function () { |
|
| 9 | + add_action('after_switch_theme', function() { |
|
| 10 | 10 | $stylesheet = get_option('stylesheet'); |
| 11 | 11 | |
| 12 | 12 | if (basename($stylesheet) !== 'templates') { |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | } |
| 15 | 15 | }); |
| 16 | 16 | |
| 17 | - add_filter('stylesheet', function ($stylesheet) { |
|
| 17 | + add_filter('stylesheet', function($stylesheet) { |
|
| 18 | 18 | return dirname($stylesheet); |
| 19 | 19 | }); |
| 20 | 20 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | if (!$acfActive || !$flyntCoreActive) { |
| 36 | - add_filter('template_include', function () { |
|
| 36 | + add_filter('template_include', function() { |
|
| 37 | 37 | $newTemplate = locate_template('plugin-inactive.php'); |
| 38 | 38 | if ('' != $newTemplate) { |
| 39 | 39 | return $newTemplate; |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | protected static function notifyRequiredPluginIsMissing($pluginName) |
| 55 | 55 | { |
| 56 | - add_action('admin_notices', function () use ($pluginName) { |
|
| 56 | + add_action('admin_notices', function() use ($pluginName) { |
|
| 57 | 57 | echo "<div class=\"error\"><p>${pluginName} Plugin not activated. Make sure you activate the plugin on the <a href=\"" |
| 58 | 58 | . esc_url(admin_url('plugins.php')) . "\">plugin page</a>.</p></div>"; |
| 59 | 59 | }); |
@@ -2,7 +2,7 @@ |
||
| 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', |
@@ -2,7 +2,7 @@ |
||
| 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', |
@@ -71,7 +71,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -4,11 +4,11 @@ discard block |
||
| 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 |
||
| 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,11 +38,11 @@ discard block |
||
| 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('wp_enqueue_scripts', function () { |
|
| 45 | +add_action('wp_enqueue_scripts', function() { |
|
| 46 | 46 | Asset::register([ |
| 47 | 47 | 'name' => 'console-polyfill', |
| 48 | 48 | 'type' => 'script', |