@@ -5,9 +5,9 @@ |
||
5 | 5 | use Flynt\Api; |
6 | 6 | use Flynt\Utils\Asset; |
7 | 7 | |
8 | -add_filter('Flynt/addComponentData?name=ListSocial', function ($data) { |
|
8 | +add_filter('Flynt/addComponentData?name=ListSocial', function($data) { |
|
9 | 9 | if (!empty($data['social'])) { |
10 | - $data['social'] = array_map(function ($item) { |
|
10 | + $data['social'] = array_map(function($item) { |
|
11 | 11 | $item['icon'] = Asset::getContents("Components/ListSocial/Assets/{$item['platform']}.svg"); |
12 | 12 | return $item; |
13 | 13 | }, $data['social']); |
@@ -4,9 +4,9 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Api; |
6 | 6 | |
7 | -add_filter('Flynt/addComponentData?name=GridDownloadPortrait', function ($data) { |
|
7 | +add_filter('Flynt/addComponentData?name=GridDownloadPortrait', function($data) { |
|
8 | 8 | if (!empty($data['items'])) { |
9 | - $data['items'] = array_map(function ($item) { |
|
9 | + $data['items'] = array_map(function($item) { |
|
10 | 10 | if ($item['itemType'] === 'itemFile') { |
11 | 11 | $fileSize = filesize(get_attached_file($item['file']['id'])); |
12 | 12 | $item['file']['fileSize'] = size_format($fileSize); |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Flynt\Components\FeaturePasswordForm; |
4 | 4 | |
5 | 5 | use Timber\Timber; |
6 | -use Timber\Post; |
|
7 | 6 | |
8 | 7 | add_filter('the_password_form', function ($output) { |
9 | 8 | $context = Timber::get_context(); |
@@ -8,7 +8,7 @@ |
||
8 | 8 | add_filter('the_password_form', function ($output) { |
9 | 9 | $context = Timber::get_context(); |
10 | 10 | $context['form'] = [ |
11 | - 'url' => site_url('/wp-login.php?action=postpass', 'login_post') |
|
11 | + 'url' => site_url('/wp-login.php?action=postpass', 'login_post') |
|
12 | 12 | ]; |
13 | 13 | |
14 | 14 | return Timber::fetch('index.twig', $context); |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use Timber\Timber; |
6 | 6 | use Timber\Post; |
7 | 7 | |
8 | -add_filter('the_password_form', function ($output) { |
|
8 | +add_filter('the_password_form', function($output) { |
|
9 | 9 | $context = Timber::get_context(); |
10 | 10 | $context['form'] = [ |
11 | 11 | 'url' => site_url('/wp-login.php?action=postpass', 'login_post') |
@@ -4,8 +4,6 @@ |
||
4 | 4 | */ |
5 | 5 | namespace Flynt\YoutubeNoCookieEmbed; |
6 | 6 | |
7 | -use Flynt\Utils\Oembed; |
|
8 | - |
|
9 | 7 | add_action('oembed_result', 'Flynt\YoutubeNoCookieEmbed\setNoCookieDomain', 10, 2); |
10 | 8 | add_filter('embed_oembed_html', 'Flynt\YoutubeNoCookieEmbed\setNoCookieDomain', 10, 2); |
11 | 9 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | |
7 | 7 | define(__NAMESPACE__ . '\NS', __NAMESPACE__ . '\\'); |
8 | 8 | |
9 | -add_action('Flynt/afterRegisterComponents', function () { |
|
9 | +add_action('Flynt/afterRegisterComponents', function() { |
|
10 | 10 | if ((WP_ENV === 'development' || current_user_can('editor') || current_user_can('administrator')) && isset($_GET['log'])) { |
11 | 11 | if (isset($_GET['component']) && !empty($_GET['component'])) { |
12 | 12 | define(__NAMESPACE__ . '\COMPONENT_WHITELIST', explode(',', $_GET['component'])); |
@@ -32,21 +32,21 @@ discard block |
||
32 | 32 | { |
33 | 33 | $type = gettype($data); |
34 | 34 | $output = json_encode($data); |
35 | - $result = "<script>console.log({$output});</script>\n"; |
|
35 | + $result = "<script>console.log({$output});</script>\n"; |
|
36 | 36 | echoDebug($result, $postpone); |
37 | 37 | } |
38 | 38 | |
39 | 39 | function consoleTable($data, $postpone = true) |
40 | 40 | { |
41 | 41 | $output = json_encode($data); |
42 | - $result = "<script>console.table({$output});</script>\n"; |
|
42 | + $result = "<script>console.table({$output});</script>\n"; |
|
43 | 43 | echoDebug($result, $postpone); |
44 | 44 | } |
45 | 45 | |
46 | 46 | function echoDebug($data, $postpone) |
47 | 47 | { |
48 | 48 | if ($postpone) { |
49 | - add_action('wp_footer', function () use ($data) { |
|
49 | + add_action('wp_footer', function() use ($data) { |
|
50 | 50 | echo $data; |
51 | 51 | }, 30); |
52 | 52 | } else { |
@@ -4,7 +4,7 @@ |
||
4 | 4 | |
5 | 5 | use Flynt\Utils\Asset; |
6 | 6 | |
7 | -add_action('wp_enqueue_scripts', function () { |
|
7 | +add_action('wp_enqueue_scripts', function() { |
|
8 | 8 | $jqueryVersion = wp_scripts()->registered['jquery']->ver; |
9 | 9 | wp_deregister_script('jquery'); |
10 | 10 |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * |
13 | 13 | * Don't return the default description in the RSS feed if it hasn't been changed |
14 | 14 | */ |
15 | -add_filter('get_bloginfo_rss', function ($bloginfo) { |
|
15 | +add_filter('get_bloginfo_rss', function($bloginfo) { |
|
16 | 16 | $defaultTagline = 'Just another WordPress site'; |
17 | 17 | return ($bloginfo === $defaultTagline) ? '' : $bloginfo; |
18 | 18 | }); |
@@ -16,12 +16,12 @@ discard block |
||
16 | 16 | function disallowRobots() |
17 | 17 | { |
18 | 18 | if (defined('WPSEO_VERSION')) { |
19 | - add_filter('wpseo_robots', function () { |
|
19 | + add_filter('wpseo_robots', function() { |
|
20 | 20 | return "noindex,nofollow"; |
21 | 21 | }); |
22 | 22 | } else { |
23 | 23 | remove_action('wp_head', 'noindex', 1); |
24 | - add_action('wp_head', function () { |
|
24 | + add_action('wp_head', function() { |
|
25 | 25 | echo "<meta name='robots' content='noindex,nofollow' />\n"; |
26 | 26 | }); |
27 | 27 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | $rules = get_option('rewrite_rules'); |
38 | 38 | |
39 | - if (! isset($rules["{$routeName}/(.*?)/?$"])) { |
|
39 | + if (!isset($rules["{$routeName}/(.*?)/?$"])) { |
|
40 | 40 | flush_rewrite_rules(); |
41 | 41 | } |
42 | 42 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | // Convert ACF Field of type relationship to a Timber\Post and add all ACF Fields of that Post |
24 | 24 | add_filter('acf/format_value/type=relationship', NS . 'formatPostObject', 100); |
25 | -add_filter('get_twig', function ($twig) { |
|
25 | +add_filter('get_twig', function($twig) { |
|
26 | 26 | $twig->addExtension(new TwigExtensionFlynt()); |
27 | 27 | return $twig; |
28 | 28 | }); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | function formatGallery($value) |
39 | 39 | { |
40 | 40 | if (!empty($value)) { |
41 | - $value = array_map(function ($image) { |
|
41 | + $value = array_map(function($image) { |
|
42 | 42 | return new Image($image); |
43 | 43 | }, $value); |
44 | 44 | } |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | return $value; |
64 | 64 | } |
65 | 65 | |
66 | -add_action('timber/twig/filters', function ($twig) { |
|
67 | - $twig->addFunction(new \Twig_SimpleFunction('placeholderImage', function ($width, $height, $color = null) { |
|
66 | +add_action('timber/twig/filters', function($twig) { |
|
67 | + $twig->addFunction(new \Twig_SimpleFunction('placeholderImage', function($width, $height, $color = null) { |
|
68 | 68 | $width = round($width); |
69 | 69 | $height = round($height); |
70 | 70 | $colorRect = $color ? "<rect width='{$width}' height='{$height}' style='fill:$color' />" : ''; |