@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Flynt\Api; |
| 6 | 6 | use Flynt\Utils\Options; |
| 7 | 7 | |
| 8 | -add_filter('Flynt/addComponentData?name=SliderImagesCentered', function ($data) { |
|
| 8 | +add_filter('Flynt/addComponentData?name=SliderImagesCentered', function($data) { |
|
| 9 | 9 | $translatableOptions = Options::get('translatableOptions', 'feature', 'SliderOptions'); |
| 10 | 10 | $data['jsonData'] = [ |
| 11 | 11 | 'options' => array_merge($translatableOptions, $data['options']), |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | namespace Flynt\TinyMce; |
| 10 | 10 | |
| 11 | 11 | // First Toolbar |
| 12 | -add_filter('mce_buttons', function ($buttons) { |
|
| 12 | +add_filter('mce_buttons', function($buttons) { |
|
| 13 | 13 | $config = getConfig(); |
| 14 | 14 | if ($config && isset($config['toolbars'])) { |
| 15 | 15 | $toolbars = $config['toolbars']; |
@@ -21,11 +21,11 @@ discard block |
||
| 21 | 21 | }); |
| 22 | 22 | |
| 23 | 23 | // Second Toolbar |
| 24 | -add_filter('mce_buttons_2', function ($buttons) { |
|
| 24 | +add_filter('mce_buttons_2', function($buttons) { |
|
| 25 | 25 | return []; |
| 26 | 26 | }); |
| 27 | 27 | |
| 28 | -add_filter('tiny_mce_before_init', function ($init) { |
|
| 28 | +add_filter('tiny_mce_before_init', function($init) { |
|
| 29 | 29 | $config = getConfig(); |
| 30 | 30 | if ($config) { |
| 31 | 31 | if (isset($config['blockformats'])) { |
@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | return $init; |
| 41 | 41 | }); |
| 42 | 42 | |
| 43 | -add_filter('acf/fields/wysiwyg/toolbars', function ($toolbars) { |
|
| 43 | +add_filter('acf/fields/wysiwyg/toolbars', function($toolbars) { |
|
| 44 | 44 | // Load Toolbars and parse them into TinyMCE |
| 45 | 45 | $config = getConfig(); |
| 46 | 46 | if ($config && !empty($config['toolbars'])) { |
| 47 | - $toolbars = array_map(function ($toolbar) { |
|
| 47 | + $toolbars = array_map(function($toolbar) { |
|
| 48 | 48 | array_unshift($toolbar, []); |
| 49 | 49 | return $toolbar; |
| 50 | 50 | }, $config['toolbars']); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | { |
| 57 | 57 | if (!empty($blockFormats)) { |
| 58 | 58 | $blockFormatStrings = array_map( |
| 59 | - function ($tag, $label) { |
|
| 59 | + function($tag, $label) { |
|
| 60 | 60 | return "${label}=${tag}"; |
| 61 | 61 | }, |
| 62 | 62 | $blockFormats, |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Flynt\Api; |
| 6 | 6 | use Flynt\Utils\Options; |
| 7 | 7 | |
| 8 | -add_filter('Flynt/addComponentData?name=HeroSlider', function ($data) { |
|
| 8 | +add_filter('Flynt/addComponentData?name=HeroSlider', function($data) { |
|
| 9 | 9 | $translatableOptions = Options::get('translatableOptions', 'feature', 'SliderOptions'); |
| 10 | 10 | $data['jsonData'] = [ |
| 11 | 11 | 'options' => array_merge($translatableOptions, $data['options']), |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | - use Timber\Timber; |
|
| 4 | - use Timber\Post; |
|
| 3 | + use Timber\Timber; |
|
| 4 | + use Timber\Post; |
|
| 5 | 5 | |
| 6 | 6 | add_filter('wp_insert_post_data', function ($data, $postArr) { |
| 7 | 7 | if ($postArr['post_type'] === 'revision') { |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | use Timber\Timber; |
| 4 | 4 | use Timber\Post; |
| 5 | 5 | |
| 6 | -add_filter('wp_insert_post_data', function ($data, $postArr) { |
|
| 6 | +add_filter('wp_insert_post_data', function($data, $postArr) { |
|
| 7 | 7 | if ($postArr['post_type'] === 'revision') { |
| 8 | 8 | return $data; |
| 9 | 9 | } |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | return $data; |
| 14 | 14 | }, 99, 2); |
| 15 | 15 | |
| 16 | -add_shortcode('flyntTheContent', function ($attrs) { |
|
| 16 | +add_shortcode('flyntTheContent', function($attrs) { |
|
| 17 | 17 | $postId = $attrs['id']; |
| 18 | 18 | $context = Timber::get_context(); |
| 19 | 19 | $context['post'] = $post = new Post($postId); |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Flynt\Utils\TwigReadingTimeExtension; |
| 6 | 6 | |
| 7 | -add_filter('get_twig', function ($twig) { |
|
| 7 | +add_filter('get_twig', function($twig) { |
|
| 8 | 8 | $twig->addExtension(new TwigReadingTimeExtension()); |
| 9 | 9 | return $twig; |
| 10 | 10 | }); |
@@ -4,10 +4,10 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Flynt\Api; |
| 6 | 6 | |
| 7 | -add_filter('Flynt/addComponentData?name=ListLogos', function ($data) { |
|
| 7 | +add_filter('Flynt/addComponentData?name=ListLogos', function($data) { |
|
| 8 | 8 | |
| 9 | 9 | if (!empty($data['items'])) { |
| 10 | - $data['items'] = array_map(function ($item) { |
|
| 10 | + $data['items'] = array_map(function($item) { |
|
| 11 | 11 | if (isset($item['image']->post_mime_type) && $item['image']->post_mime_type === 'image/svg+xml') { |
| 12 | 12 | $path = get_attached_file($item['image']->ID); |
| 13 | 13 | $item['image']->svg = file_get_contents($path); |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | const POST_TYPE = 'post'; |
| 10 | 10 | const FILTER_BY_TAXONOMY = 'category'; |
| 11 | 11 | |
| 12 | -add_filter('Flynt/addComponentData?name=GridPostsArchive', function ($data) { |
|
| 12 | +add_filter('Flynt/addComponentData?name=GridPostsArchive', function($data) { |
|
| 13 | 13 | $postType = POST_TYPE; |
| 14 | 14 | $taxonomy = FILTER_BY_TAXONOMY; |
| 15 | 15 | $terms = get_terms([ |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | ]); |
| 19 | 19 | $queriedObject = get_queried_object(); |
| 20 | 20 | if (count($terms) > 1) { |
| 21 | - $data['terms'] = array_map(function ($term) use ($queriedObject) { |
|
| 21 | + $data['terms'] = array_map(function($term) use ($queriedObject) { |
|
| 22 | 22 | $timberTerm = new Term($term); |
| 23 | 23 | if ($queriedObject) { |
| 24 | 24 | $timberTerm->isActive = $queriedObject->taxonomy === $term->taxonomy && $queriedObject->term_id === $term->term_id; |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $data['isHome'] = true; |
| 38 | 38 | $data['title'] = $queriedObject->post_title ?? get_bloginfo('name'); |
| 39 | 39 | } else { |
| 40 | - $data['title'] = get_the_archive_title(); |
|
| 40 | + $data['title'] = get_the_archive_title(); |
|
| 41 | 41 | $data['description'] = get_the_archive_description(); |
| 42 | 42 | } |
| 43 | 43 | |
@@ -385,12 +385,12 @@ |
||
| 385 | 385 | 'type' => 'text', |
| 386 | 386 | 'required' => 1, |
| 387 | 387 | 'default_value' => ',' |
| 388 | - ], |
|
| 389 | - [ |
|
| 388 | + ], |
|
| 389 | + [ |
|
| 390 | 390 | 'label' => 'Thousands Separator', |
| 391 | 391 | 'name' => 'thousandsSeparator', |
| 392 | 392 | 'type' => 'text', |
| 393 | 393 | 'required' => 1, |
| 394 | 394 | 'default_value' => '.' |
| 395 | - ] |
|
| 395 | + ] |
|
| 396 | 396 | ]); |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | |
| 7 | 7 | function createFeatherIconSelectChoices($iconKeys = []) |
| 8 | 8 | { |
| 9 | - return array_reduce($iconKeys, function ($acc, $iconKey) { |
|
| 9 | + return array_reduce($iconKeys, function($acc, $iconKey) { |
|
| 10 | 10 | $acc[$iconKey] = "<i style='width: 16px; height: 16px; vertical-align: middle; position: relative; top: -2px;margin-right: 5px' data-feather='{$iconKey}'></i> {$iconKey}"; |
| 11 | 11 | return $acc; |
| 12 | 12 | }, []); |