@@ -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 | }); |
@@ -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 | |
@@ -8,14 +8,14 @@ |
||
| 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 | $data['taxonomies'] = $data['taxonomies'] ?: []; |
| 14 | 14 | |
| 15 | 15 | $data['items'] = Timber::get_posts([ |
| 16 | 16 | 'post_status' => 'publish', |
| 17 | 17 | 'post_type' => $postType, |
| 18 | - 'category' => join(',', array_map(function ($taxonomy) { |
|
| 18 | + 'category' => join(',', array_map(function($taxonomy) { |
|
| 19 | 19 | return $taxonomy->term_id; |
| 20 | 20 | }, $data['taxonomies'])), |
| 21 | 21 | 'posts_per_page' => $data['options']['postCount'], |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Flynt\Utils\Options; |
| 6 | 6 | |
| 7 | -add_filter('Flynt/addComponentData?name=BlockPostHeader', function ($data) { |
|
| 7 | +add_filter('Flynt/addComponentData?name=BlockPostHeader', function($data) { |
|
| 8 | 8 | |
| 9 | 9 | return $data; |
| 10 | 10 | }); |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | |
| 37 | 37 | if (!$acfActive) { |
| 38 | 38 | self::notifyRequiredPluginIsMissing('ACF'); |
| 39 | - add_filter('template_include', function () { |
|
| 39 | + add_filter('template_include', function() { |
|
| 40 | 40 | die( |
| 41 | 41 | 'One or more required plugins are not activated! Please <a href="' |
| 42 | 42 | . esc_url(admin_url('plugins.php')) |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | |
| 4 | 4 | use Flynt\Utils\Options; |
| 5 | 5 | |
| 6 | -add_filter('pre_http_request', function ($preempt, $args, $url) { |
|
| 6 | +add_filter('pre_http_request', function($preempt, $args, $url) { |
|
| 7 | 7 | if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) { |
| 8 | 8 | $response = wp_cache_get($url, 'oembedCache'); |
| 9 | 9 | if (!empty($response)) { |
@@ -13,14 +13,14 @@ discard block |
||
| 13 | 13 | return false; |
| 14 | 14 | }, 10, 3); |
| 15 | 15 | |
| 16 | -add_filter('http_response', function ($response, $args, $url) { |
|
| 16 | +add_filter('http_response', function($response, $args, $url) { |
|
| 17 | 17 | if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) { |
| 18 | 18 | wp_cache_set($url, $response, 'oembedCache'); |
| 19 | 19 | } |
| 20 | 20 | return $response; |
| 21 | 21 | }, 10, 3); |
| 22 | 22 | |
| 23 | -add_filter('acf/fields/google_map/api', function ($api) { |
|
| 23 | +add_filter('acf/fields/google_map/api', function($api) { |
|
| 24 | 24 | $apiKey = Options::getGlobal('Acf', 'googleMapsApiKey'); |
| 25 | 25 | if ($apiKey) { |
| 26 | 26 | $api['key'] = $apiKey; |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | function addOptionsToComponent($data, $componentName) |
| 15 | 15 | { |
| 16 | 16 | // get fields for this component |
| 17 | - $options = array_reduce(array_keys(Options::OPTION_TYPES), function ($carry, $optionType) use ($componentName) { |
|
| 17 | + $options = array_reduce(array_keys(Options::OPTION_TYPES), function($carry, $optionType) use ($componentName) { |
|
| 18 | 18 | return array_merge($carry, Options::get($optionType, $componentName)); |
| 19 | 19 | }, []); |
| 20 | 20 | // don't overwrite existing data |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | static::$initialized = true; |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - add_action('current_screen', function ($currentScreen) { |
|
| 36 | + add_action('current_screen', function($currentScreen) { |
|
| 37 | 37 | $currentScreenId = strtolower($currentScreen->id); |
| 38 | 38 | foreach (static::OPTION_TYPES as $optionType => $option) { |
| 39 | 39 | $isTranslatable = $option['translatable']; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | 101 |
| 59 | 59 | ); |
| 60 | 60 | // hide language selector in admin bar |
| 61 | - add_action('wp_before_admin_bar_render', function () { |
|
| 61 | + add_action('wp_before_admin_bar_render', function() { |
|
| 62 | 62 | $adminBar = $GLOBALS['wp_admin_bar']; |
| 63 | 63 | $adminBar->remove_menu('WPML_ALS'); |
| 64 | 64 | }); |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $optionNames = ((static::$registeredOptions[$optionType] ?? [])[$scope] ?? []); |
| 179 | 179 | return array_combine( |
| 180 | 180 | $optionNames, |
| 181 | - array_map(function ($optionName) use ($prefix, $isTranslatable) { |
|
| 181 | + array_map(function($optionName) use ($prefix, $isTranslatable) { |
|
| 182 | 182 | $fieldKey = $prefix . $optionName; |
| 183 | 183 | return static::getOptionField($fieldKey, $isTranslatable); |
| 184 | 184 | }, $optionNames) |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | |
| 260 | 260 | protected static function prefixFields($fields, $prefix) |
| 261 | 261 | { |
| 262 | - return array_map(function ($field) use ($prefix) { |
|
| 262 | + return array_map(function($field) use ($prefix) { |
|
| 263 | 263 | $field['name'] = $prefix . '_' . $field['name']; |
| 264 | 264 | return $field; |
| 265 | 265 | }, $fields); |