@@ -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'); |
@@ -34,11 +34,11 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public static function indexedValuesToAssocKeys(array $array) |
| 36 | 36 | { |
| 37 | - $values = array_map(function ($value) { |
|
| 37 | + $values = array_map(function($value) { |
|
| 38 | 38 | return is_array($value) ? $value : []; |
| 39 | 39 | }, $array); |
| 40 | 40 | |
| 41 | - $keys = array_map(function ($key) use ($array) { |
|
| 41 | + $keys = array_map(function($key) use ($array) { |
|
| 42 | 42 | return is_int($key) ? $array[$key] : $key; |
| 43 | 43 | }, array_keys($array)); |
| 44 | 44 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | |
| 73 | 73 | public static function registerHooks() |
| 74 | 74 | { |
| 75 | - add_filter('Flynt/renderComponent', function ($output, $componentName, $data) { |
|
| 75 | + add_filter('Flynt/renderComponent', function($output, $componentName, $data) { |
|
| 76 | 76 | return apply_filters( |
| 77 | 77 | "Flynt/renderComponent?name={$componentName}", |
| 78 | 78 | $output, |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | ); |
| 82 | 82 | }, 10, 3); |
| 83 | 83 | |
| 84 | - add_filter('Flynt/addComponentData', function ($data, $componentName) { |
|
| 84 | + add_filter('Flynt/addComponentData', function($data, $componentName) { |
|
| 85 | 85 | return apply_filters( |
| 86 | 86 | "Flynt/addComponentData?name={$componentName}", |
| 87 | 87 | $data, |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | return ''; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - $data = function () use ($componentData) { |
|
| 42 | + $data = function() use ($componentData) { |
|
| 43 | 43 | $args = func_get_args(); |
| 44 | 44 | array_unshift($args, $componentData); |
| 45 | 45 | return Helpers::extractNestedDataFromArray($args); |
@@ -6,13 +6,13 @@ |
||
| 6 | 6 | use Flynt\Utils\Asset; |
| 7 | 7 | use Flynt\Utils\Options; |
| 8 | 8 | |
| 9 | -add_action('init', function () { |
|
| 9 | +add_action('init', function() { |
|
| 10 | 10 | register_nav_menus([ |
| 11 | 11 | 'navigation_burger' => __('Navigation Burger', 'flynt') |
| 12 | 12 | ]); |
| 13 | 13 | }); |
| 14 | 14 | |
| 15 | -add_filter('Flynt/addComponentData?name=NavigationBurger', function ($data) { |
|
| 15 | +add_filter('Flynt/addComponentData?name=NavigationBurger', function($data) { |
|
| 16 | 16 | $data['menu'] = new Timber\Menu('navigation_burger'); |
| 17 | 17 | $data['logo'] = [ |
| 18 | 18 | 'src' => Asset::requireUrl( |
@@ -5,13 +5,13 @@ |
||
| 5 | 5 | use Timber; |
| 6 | 6 | use Flynt\Utils\Asset; |
| 7 | 7 | |
| 8 | -add_action('init', function () { |
|
| 8 | +add_action('init', function() { |
|
| 9 | 9 | register_nav_menus([ |
| 10 | 10 | 'navigation_main' => __('Navigation Main', 'flynt') |
| 11 | 11 | ]); |
| 12 | 12 | }); |
| 13 | 13 | |
| 14 | -add_filter('Flynt/addComponentData?name=NavigationMain', function ($data) { |
|
| 14 | +add_filter('Flynt/addComponentData?name=NavigationMain', function($data) { |
|
| 15 | 15 | $data['menu'] = new Timber\Menu('navigation_main'); |
| 16 | 16 | $data['logo'] = [ |
| 17 | 17 | 'src' => Asset::requireUrl('Components/NavigationMain/Assets/logo.svg'), |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | namespace Flynt\TinyMce; |
| 10 | 10 | |
| 11 | 11 | // First Toolbar |
| 12 | -add_filter('mce_buttons', function ($buttons) { |
|
| 12 | +add_filter('mce_buttons', function($buttons) { |
|
| 13 | 13 | $config = getConfig(); |
| 14 | 14 | if ($config && isset($config['toolbars'])) { |
| 15 | 15 | $toolbars = $config['toolbars']; |
@@ -21,11 +21,11 @@ discard block |
||
| 21 | 21 | }); |
| 22 | 22 | |
| 23 | 23 | // Second Toolbar |
| 24 | -add_filter('mce_buttons_2', function ($buttons) { |
|
| 24 | +add_filter('mce_buttons_2', function($buttons) { |
|
| 25 | 25 | return []; |
| 26 | 26 | }); |
| 27 | 27 | |
| 28 | -add_filter('tiny_mce_before_init', function ($init) { |
|
| 28 | +add_filter('tiny_mce_before_init', function($init) { |
|
| 29 | 29 | $config = getConfig(); |
| 30 | 30 | if ($config) { |
| 31 | 31 | if (isset($config['blockformats'])) { |
@@ -40,11 +40,11 @@ discard block |
||
| 40 | 40 | return $init; |
| 41 | 41 | }); |
| 42 | 42 | |
| 43 | -add_filter('acf/fields/wysiwyg/toolbars', function ($toolbars) { |
|
| 43 | +add_filter('acf/fields/wysiwyg/toolbars', function($toolbars) { |
|
| 44 | 44 | // Load Toolbars and parse them into TinyMCE |
| 45 | 45 | $config = getConfig(); |
| 46 | 46 | if ($config && !empty($config['toolbars'])) { |
| 47 | - $toolbars = array_map(function ($toolbar) { |
|
| 47 | + $toolbars = array_map(function($toolbar) { |
|
| 48 | 48 | array_unshift($toolbar, []); |
| 49 | 49 | return $toolbar; |
| 50 | 50 | }, $config['toolbars']); |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | { |
| 57 | 57 | if (!empty($blockFormats)) { |
| 58 | 58 | $blockFormatStrings = array_map( |
| 59 | - function ($tag, $label) { |
|
| 59 | + function($tag, $label) { |
|
| 60 | 60 | return "${label}=${tag}"; |
| 61 | 61 | }, |
| 62 | 62 | $blockFormats, |