@@ -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 | }); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | const POST_TYPE = 'post'; |
| 10 | 10 | |
| 11 | -add_filter('Flynt/addComponentData?name=GridPostsLatest', function ($data) { |
|
| 11 | +add_filter('Flynt/addComponentData?name=GridPostsLatest', function($data) { |
|
| 12 | 12 | $postType = POST_TYPE; |
| 13 | 13 | |
| 14 | 14 | $data['items'] = Timber::get_posts([ |
@@ -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 | |
@@ -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 | }, []); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | return $wpdb->prefix . TABLE_NAME; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | -call_user_func(function () { |
|
| 20 | +call_user_func(function() { |
|
| 21 | 21 | $optionName = TABLE_NAME . '_db_version'; |
| 22 | 22 | |
| 23 | 23 | $installedVersion = get_option($optionName); |
@@ -40,9 +40,9 @@ discard block |
||
| 40 | 40 | } |
| 41 | 41 | }); |
| 42 | 42 | |
| 43 | -add_action('timber/twig/filters', function ($twig) { |
|
| 43 | +add_action('timber/twig/filters', function($twig) { |
|
| 44 | 44 | $twig->addFilter( |
| 45 | - new Twig_SimpleFilter('resizeDynamic', function ( |
|
| 45 | + new Twig_SimpleFilter('resizeDynamic', function( |
|
| 46 | 46 | $src, |
| 47 | 47 | $w, |
| 48 | 48 | $h = 0, |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | return $twig; |
| 85 | 85 | }); |
| 86 | 86 | |
| 87 | -Routes::map(IMAGE_ROUTE, function () { |
|
| 87 | +Routes::map(IMAGE_ROUTE, function() { |
|
| 88 | 88 | $src = str_replace( |
| 89 | 89 | '/app/uploads/' . IMAGE_PATH_SEPARATOR . '/', |
| 90 | 90 | '/app/uploads/', |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | if ($localDev) { |
| 108 | 108 | $src = http_build_url($homeUrl, ['path' => $urlParts['path']]); |
| 109 | 109 | } |
| 110 | - $moveImageFunction = function ($location) { |
|
| 110 | + $moveImageFunction = function($location) { |
|
| 111 | 111 | return str_replace( |
| 112 | 112 | '/app/uploads/', |
| 113 | 113 | '/app/uploads/' . IMAGE_PATH_SEPARATOR . '/', |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | |
| 9 | 9 | const POST_TYPE = 'post'; |
| 10 | 10 | |
| 11 | -add_filter('Flynt/addComponentData?name=GridPostsTeaser', function ($data) { |
|
| 11 | +add_filter('Flynt/addComponentData?name=GridPostsTeaser', function($data) { |
|
| 12 | 12 | $postType = POST_TYPE; |
| 13 | 13 | |
| 14 | 14 | $data['items'] = Timber::get_posts([ |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | ]); |
| 21 | 21 | |
| 22 | 22 | if (!empty($data['items'])) { |
| 23 | - $data['items'] = array_map(function ($item) { |
|
| 23 | + $data['items'] = array_map(function($item) { |
|
| 24 | 24 | $item->category = get_the_category($item)[0]; |
| 25 | 25 | return $item; |
| 26 | 26 | }, $data['items']); |
@@ -7,11 +7,11 @@ discard block |
||
| 7 | 7 | use Flynt\Utils\Options; |
| 8 | 8 | use Flynt\Utils\Asset; |
| 9 | 9 | |
| 10 | -add_filter('Flynt/addComponentData?name=ListComponents', function ($data) { |
|
| 10 | +add_filter('Flynt/addComponentData?name=ListComponents', function($data) { |
|
| 11 | 11 | if (!empty($data['componentBlocks'])) { |
| 12 | - $data['componentBlocks'] = array_map(function ($block) { |
|
| 12 | + $data['componentBlocks'] = array_map(function($block) { |
|
| 13 | 13 | $componentPaths = explode('/', $block['component']); |
| 14 | - $block['component'] = implode('/', array_slice($componentPaths, count($componentPaths)-3, 3)); |
|
| 14 | + $block['component'] = implode('/', array_slice($componentPaths, count($componentPaths) - 3, 3)); |
|
| 15 | 15 | |
| 16 | 16 | if (file_exists(Asset::requirePath($block['component'] . 'screenshot.png'))) { |
| 17 | 17 | $src = Asset::requireUrl($block['component'] . 'screenshot.png'); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | return $data; |
| 37 | 37 | }); |
| 38 | 38 | |
| 39 | -add_filter('acf/load_field/name=component', function ($field) { |
|
| 39 | +add_filter('acf/load_field/name=component', function($field) { |
|
| 40 | 40 | $componentManager = ComponentManager::getInstance(); |
| 41 | 41 | $field['choices'] = array_flip($componentManager->getAll()); |
| 42 | 42 | return $field; |