@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -add_action('after_setup_theme', function () { |
|
| 3 | +add_action('after_setup_theme', function() { |
|
| 4 | 4 | add_theme_support('title-tag'); |
| 5 | 5 | add_theme_support('post-thumbnails'); |
| 6 | 6 | }); |
@@ -28,11 +28,11 @@ discard block |
||
| 28 | 28 | * Remove self-closing tag |
| 29 | 29 | * |
| 30 | 30 | */ |
| 31 | -add_action('init', function () { |
|
| 31 | +add_action('init', function() { |
|
| 32 | 32 | // Originally from http://wpengineer.com/1438/wordpress-header/ |
| 33 | 33 | remove_action('wp_head', 'feed_links_extra', 3); |
| 34 | 34 | add_action('wp_head', 'ob_start', 1, 0); |
| 35 | - add_action('wp_head', function () { |
|
| 35 | + add_action('wp_head', function() { |
|
| 36 | 36 | $pattern = '/.*' . preg_quote(esc_url(get_feed_link('comments_' . get_default_feed())), '/') . '.*[\r\n]+/'; |
| 37 | 37 | echo preg_replace($pattern, '', ob_get_clean()); |
| 38 | 38 | }, 3, 0); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * |
| 61 | 61 | * Clean up output of stylesheet <link> tags |
| 62 | 62 | */ |
| 63 | -add_filter('style_loader_tag', function ($input) { |
|
| 63 | +add_filter('style_loader_tag', function($input) { |
|
| 64 | 64 | preg_match_all( |
| 65 | 65 | "!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!", |
| 66 | 66 | $input, |
@@ -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 | }); |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | use Flynt\Utils\Asset; |
| 4 | 4 | |
| 5 | -add_action('wp_enqueue_scripts', function () { |
|
| 5 | +add_action('wp_enqueue_scripts', function() { |
|
| 6 | 6 | Asset::enqueue([ |
| 7 | 7 | 'name' => 'Flynt/assets', |
| 8 | 8 | 'path' => 'assets/main.js', |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | ]); |
| 19 | 19 | }); |
| 20 | 20 | |
| 21 | -add_action('admin_enqueue_scripts', function () { |
|
| 21 | +add_action('admin_enqueue_scripts', function() { |
|
| 22 | 22 | Asset::enqueue([ |
| 23 | 23 | 'name' => 'Flynt/assets/admin', |
| 24 | 24 | 'path' => 'assets/admin.js', |
@@ -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 | |
@@ -149,10 +149,10 @@ |
||
| 149 | 149 | } |
| 150 | 150 | if ($type === 'style') { |
| 151 | 151 | global $wp_styles; |
| 152 | - $repo =& $wp_styles; |
|
| 152 | + $repo = & $wp_styles; |
|
| 153 | 153 | } else { |
| 154 | 154 | global $wp_scripts; |
| 155 | - $repo =& $wp_scripts; |
|
| 155 | + $repo = & $wp_scripts; |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | $asset = $repo->query($handle, 'registered'); |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | acf_add_local_field_group($fieldGroup); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - add_action('current_screen', function ($currentScreen) { |
|
| 90 | + add_action('current_screen', function($currentScreen) { |
|
| 91 | 91 | foreach (static::OPTION_TYPES as $optionType => $option) { |
| 92 | 92 | $isTranslatable = $option['translatable']; |
| 93 | 93 | $toplevelPageId = 'toplevel_page_' . $optionType; |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | add_filter('acf/settings/current_language', 'Flynt\Utils\Options::getDefaultAcfLanguage', 101); |
| 102 | 102 | |
| 103 | 103 | // hide language selector in admin bar |
| 104 | - add_action('wp_before_admin_bar_render', function () { |
|
| 104 | + add_action('wp_before_admin_bar_render', function() { |
|
| 105 | 105 | $adminBar = $GLOBALS['wp_admin_bar']; |
| 106 | 106 | $adminBar->remove_menu('WPML_ALS'); |
| 107 | 107 | }); |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | $optionNames = (((static::$registeredOptions[$optionType] ?? [])[lcfirst($optionCategory)] ?? [])[$subPageName] ?? []); |
| 152 | 152 | return array_combine( |
| 153 | 153 | $optionNames, |
| 154 | - array_map(function ($optionName) use ($prefix, $isTranslatable) { |
|
| 154 | + array_map(function($optionName) use ($prefix, $isTranslatable) { |
|
| 155 | 155 | $fieldKey = $prefix . $optionName; |
| 156 | 156 | return static::getOptionField($fieldKey, $isTranslatable); |
| 157 | 157 | }, $optionNames) |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | protected static function prefixFields($fields, $prefix) |
| 237 | 237 | { |
| 238 | - return array_map(function ($field) use ($prefix) { |
|
| 238 | + return array_map(function($field) use ($prefix) { |
|
| 239 | 239 | $field['name'] = $prefix . '_' . $field['name']; |
| 240 | 240 | return $field; |
| 241 | 241 | }, $fields); |