@@ -3,7 +3,7 @@ |
||
| 3 | 3 | use ACFComposer\ACFComposer; |
| 4 | 4 | use Flynt\Api; |
| 5 | 5 | |
| 6 | -add_action('Flynt/afterRegisterComponents', function () { |
|
| 6 | +add_action('Flynt/afterRegisterComponents', function() { |
|
| 7 | 7 | ACFComposer::registerFieldGroup([ |
| 8 | 8 | 'name' => 'postComponents', |
| 9 | 9 | 'title' => 'Post Components', |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | |
| 27 | 27 | // Convert ACF Field of type relationship to a Timber\Post and add all ACF Fields of that Post |
| 28 | 28 | add_filter('acf/format_value/type=relationship', NS . 'formatPostObject', 100); |
| 29 | -add_filter('get_twig', function ($twig) { |
|
| 29 | +add_filter('get_twig', function($twig) { |
|
| 30 | 30 | $twig->addExtension(new TwigExtensionFlynt()); |
| 31 | 31 | return $twig; |
| 32 | 32 | }); |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | function formatGallery($value) |
| 43 | 43 | { |
| 44 | 44 | if (!empty($value)) { |
| 45 | - $value = array_map(function ($image) { |
|
| 45 | + $value = array_map(function($image) { |
|
| 46 | 46 | return new Image($image); |
| 47 | 47 | }, $value); |
| 48 | 48 | } |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | return $value; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | -add_action('timber/twig/filters', function ($twig) { |
|
| 71 | - $twig->addFunction(new \Twig_SimpleFunction('placeholderImage', function ($width, $height, $color = null) { |
|
| 70 | +add_action('timber/twig/filters', function($twig) { |
|
| 71 | + $twig->addFunction(new \Twig_SimpleFunction('placeholderImage', function($width, $height, $color = null) { |
|
| 72 | 72 | $width = round($width); |
| 73 | 73 | $height = round($height); |
| 74 | 74 | $colorRect = $color ? "<rect width='{$width}' height='{$height}' style='fill:$color' />" : ''; |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | |
| 9 | 9 | use Flynt\Utils\Asset; |
| 10 | 10 | |
| 11 | -add_action('wp_enqueue_scripts', function () { |
|
| 11 | +add_action('wp_enqueue_scripts', function() { |
|
| 12 | 12 | $jqueryVersion = wp_scripts()->registered['jquery']->ver; |
| 13 | 13 | wp_deregister_script('jquery'); |
| 14 | 14 | |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | define(__NAMESPACE__ . '\NS', __NAMESPACE__ . '\\'); |
| 12 | 12 | |
| 13 | -add_action('Flynt/afterRegisterComponents', function () { |
|
| 13 | +add_action('Flynt/afterRegisterComponents', function() { |
|
| 14 | 14 | if ((WP_ENV === 'development' || current_user_can('editor') || current_user_can('administrator')) && isset($_GET['log'])) { |
| 15 | 15 | if (isset($_GET['component']) && !empty($_GET['component'])) { |
| 16 | 16 | define(__NAMESPACE__ . '\COMPONENT_WHITELIST', explode(',', $_GET['component'])); |
@@ -36,21 +36,21 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | $type = gettype($data); |
| 38 | 38 | $output = json_encode($data); |
| 39 | - $result = "<script>console.log({$output});</script>\n"; |
|
| 39 | + $result = "<script>console.log({$output});</script>\n"; |
|
| 40 | 40 | echoDebug($result, $postpone); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | function consoleTable($data, $postpone = true) |
| 44 | 44 | { |
| 45 | 45 | $output = json_encode($data); |
| 46 | - $result = "<script>console.table({$output});</script>\n"; |
|
| 46 | + $result = "<script>console.table({$output});</script>\n"; |
|
| 47 | 47 | echoDebug($result, $postpone); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | function echoDebug($data, $postpone) |
| 51 | 51 | { |
| 52 | 52 | if ($postpone) { |
| 53 | - add_action('wp_footer', function () use ($data) { |
|
| 53 | + add_action('wp_footer', function() use ($data) { |
|
| 54 | 54 | echo $data; |
| 55 | 55 | }, 30); |
| 56 | 56 | } else { |
@@ -21,12 +21,12 @@ discard block |
||
| 21 | 21 | function disallowRobots() |
| 22 | 22 | { |
| 23 | 23 | if (defined('WPSEO_VERSION')) { |
| 24 | - add_filter('wpseo_robots', function () { |
|
| 24 | + add_filter('wpseo_robots', function() { |
|
| 25 | 25 | return "noindex,nofollow"; |
| 26 | 26 | }); |
| 27 | 27 | } else { |
| 28 | 28 | remove_action('wp_head', 'noindex', 1); |
| 29 | - add_action('wp_head', function () { |
|
| 29 | + add_action('wp_head', function() { |
|
| 30 | 30 | echo "<meta name='robots' content='noindex,nofollow' />\n"; |
| 31 | 31 | }); |
| 32 | 32 | } |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | $rules = get_option('rewrite_rules'); |
| 43 | 43 | |
| 44 | - if (! isset($rules["{$routeName}/(.*?)/?$"])) { |
|
| 44 | + if (!isset($rules["{$routeName}/(.*?)/?$"])) { |
|
| 45 | 45 | flush_rewrite_rules(); |
| 46 | 46 | } |
| 47 | 47 | } |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | */ |
| 6 | 6 | namespace Flynt\HideProtectedPosts; |
| 7 | 7 | |
| 8 | -add_action('pre_get_posts', function ($query) { |
|
| 8 | +add_action('pre_get_posts', function($query) { |
|
| 9 | 9 | if (!$query->is_singular() && !is_admin()) { |
| 10 | 10 | $query->set('has_password', false); |
| 11 | 11 | } |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | */ |
| 5 | 5 | namespace Flynt\RemoveEditor; |
| 6 | 6 | |
| 7 | -add_action('init', function () { |
|
| 7 | +add_action('init', function() { |
|
| 8 | 8 | remove_post_type_support('page', 'editor'); |
| 9 | 9 | remove_post_type_support('post', 'editor'); |
| 10 | 10 | }); |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | * |
| 18 | 18 | * Don't return the default description in the RSS feed if it hasn't been changed |
| 19 | 19 | */ |
| 20 | -add_filter('get_bloginfo_rss', function ($bloginfo) { |
|
| 20 | +add_filter('get_bloginfo_rss', function($bloginfo) { |
|
| 21 | 21 | $defaultTagline = 'Just another WordPress site'; |
| 22 | 22 | return ($bloginfo === $defaultTagline) ? '' : $bloginfo; |
| 23 | 23 | }); |
@@ -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::get('globalOptions', 'feature', 'Acf', 'googleMapsApiKey'); |
| 25 | 25 | if ($apiKey) { |
| 26 | 26 | $api['key'] = $apiKey; |