@@ -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 { |
@@ -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 | }); |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | */ |
| 5 | 5 | namespace Flynt\MimeTypes; |
| 6 | 6 | |
| 7 | -add_filter('upload_mimes', function ($mimes) { |
|
| 7 | +add_filter('upload_mimes', function($mimes) { |
|
| 8 | 8 | $mimes['svg'] = 'image/svg+xml'; |
| 9 | 9 | return $mimes; |
| 10 | 10 | }); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | if (count($files) === 0) { |
| 58 | 58 | $dir = get_template_directory() . '/' . $dir; |
| 59 | 59 | |
| 60 | - self::iterateDir($dir, function ($file) { |
|
| 60 | + self::iterateDir($dir, function($file) { |
|
| 61 | 61 | if ($file->isDir()) { |
| 62 | 62 | $dirPath = trim(str_replace(get_template_directory(), '', $file->getPathname()), '/'); |
| 63 | 63 | self::loadPhpFiles($dirPath); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | } |
| 68 | 68 | }); |
| 69 | 69 | } else { |
| 70 | - array_walk($files, function ($file) use ($dir) { |
|
| 70 | + array_walk($files, function($file) use ($dir) { |
|
| 71 | 71 | $filePath = $dir . '/' . ltrim($file, '/'); |
| 72 | 72 | |
| 73 | 73 | if (!locate_template($filePath, true, true)) { |
@@ -66,10 +66,10 @@ discard block |
||
| 66 | 66 | public static function consoleDebug($data, $postpone = true, $title = 'PHP', $logType = 'log') |
| 67 | 67 | { |
| 68 | 68 | if (in_array($logType, ['log', 'error', 'trace'])) { |
| 69 | - $title .= '(' . self::getCallerFile(2) .'):'; |
|
| 69 | + $title .= '(' . self::getCallerFile(2) . '):'; |
|
| 70 | 70 | $type = gettype($data); |
| 71 | 71 | $output = json_encode($data); |
| 72 | - $result = "<script>console.{$logType}('{$title}', '({$type})', {$output});</script>\n"; |
|
| 72 | + $result = "<script>console.{$logType}('{$title}', '({$type})', {$output});</script>\n"; |
|
| 73 | 73 | self::echoDebug($result, $postpone); |
| 74 | 74 | } |
| 75 | 75 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | protected static function echoDebug($data, $postpone) |
| 111 | 111 | { |
| 112 | 112 | if ($postpone) { |
| 113 | - add_action('wp_footer', function () use ($data) { |
|
| 113 | + add_action('wp_footer', function() use ($data) { |
|
| 114 | 114 | echo $data; |
| 115 | 115 | }, 30); |
| 116 | 116 | } else { |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | . "<p><strong>{$options['title']}</strong></p>" |
| 86 | 86 | . $msg . '</div>'; |
| 87 | 87 | |
| 88 | - add_action('admin_notices', function () use ($msg) { |
|
| 88 | + add_action('admin_notices', function() use ($msg) { |
|
| 89 | 89 | echo $msg; |
| 90 | 90 | }); |
| 91 | 91 | |