@@ -51,7 +51,7 @@ |
||
| 51 | 51 | if (is_array($value)) { |
| 52 | 52 | // Loop through array and apply translations while keeping keys intact |
| 53 | 53 | // NOTE: assuming it's a single dimensional array |
| 54 | - return array_reduce(array_keys($value), function ($carry, $key) use ($value) { |
|
| 54 | + return array_reduce(array_keys($value), function($carry, $key) use ($value) { |
|
| 55 | 55 | return array_merge($carry, [ |
| 56 | 56 | $key => _x($value[$key], $key, 'flynt-starter-theme') |
| 57 | 57 | ]); |
@@ -4,6 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Flynt\Features\Components\Component; |
| 6 | 6 | |
| 7 | -add_action('wp_enqueue_scripts', function () { |
|
| 7 | +add_action('wp_enqueue_scripts', function() { |
|
| 8 | 8 | Component::enqueueAssets('BlockImage'); |
| 9 | 9 | }); |
@@ -3,6 +3,6 @@ |
||
| 3 | 3 | |
| 4 | 4 | use Flynt\Features\Components\Component; |
| 5 | 5 | |
| 6 | -add_action('wp_enqueue_scripts', function () { |
|
| 6 | +add_action('wp_enqueue_scripts', function() { |
|
| 7 | 7 | Component::enqueueAssets('BlockWysiwyg'); |
| 8 | 8 | }); |
@@ -4,6 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Flynt\Features\Components\Component; |
| 6 | 6 | |
| 7 | -add_action('wp_enqueue_scripts', function () { |
|
| 7 | +add_action('wp_enqueue_scripts', function() { |
|
| 8 | 8 | Component::enqueueAssets('BlockNotFound'); |
| 9 | 9 | }); |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | { |
| 7 | 7 | public static function setTemplateDirectory() |
| 8 | 8 | { |
| 9 | - add_action('after_switch_theme', function () { |
|
| 9 | + add_action('after_switch_theme', function() { |
|
| 10 | 10 | $stylesheet = get_option('stylesheet'); |
| 11 | 11 | |
| 12 | 12 | if (basename($stylesheet) !== 'templates') { |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | } |
| 15 | 15 | }); |
| 16 | 16 | |
| 17 | - add_filter('stylesheet', function ($stylesheet) { |
|
| 17 | + add_filter('stylesheet', function($stylesheet) { |
|
| 18 | 18 | return dirname($stylesheet); |
| 19 | 19 | }); |
| 20 | 20 | } |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | if (!$acfActive || !$flyntCoreActive) { |
| 36 | - add_filter('template_include', function () { |
|
| 36 | + add_filter('template_include', function() { |
|
| 37 | 37 | $newTemplate = locate_template('plugin-inactive.php'); |
| 38 | 38 | if ('' != $newTemplate) { |
| 39 | 39 | return $newTemplate; |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | protected static function notifyRequiredPluginIsMissing($pluginName) |
| 55 | 55 | { |
| 56 | - add_action('admin_notices', function () use ($pluginName) { |
|
| 56 | + add_action('admin_notices', function() use ($pluginName) { |
|
| 57 | 57 | echo "<div class=\"error\"><p>${pluginName} Plugin not activated. Make sure you activate the plugin on the <a href=\"" |
| 58 | 58 | . esc_url(admin_url('plugins.php')) . "\">plugin page</a>.</p></div>"; |
| 59 | 59 | }); |
@@ -38,10 +38,10 @@ discard block |
||
| 38 | 38 | if (is_admin()) { |
| 39 | 39 | add_action('admin_enqueue_scripts', NS . 'enqueueComponentScripts'); |
| 40 | 40 | // add image to the flexible content component name |
| 41 | - add_filter('acf/fields/flexible_content/layout_title', function ($title, $field, $layout, $i) { |
|
| 41 | + add_filter('acf/fields/flexible_content/layout_title', function($title, $field, $layout, $i) { |
|
| 42 | 42 | $componentName = ucfirst($layout['name']); |
| 43 | 43 | $componentPath = "Components/{$componentName}"; |
| 44 | - $componentPreviewDesktopPath = Asset::requirePath("{$componentPath}/preview-desktop.jpg") ; |
|
| 44 | + $componentPreviewDesktopPath = Asset::requirePath("{$componentPath}/preview-desktop.jpg"); |
|
| 45 | 45 | $componentPreviewDesktopUrl = Asset::requireUrl("{$componentPath}/preview-desktop.jpg"); |
| 46 | 46 | if (is_file($componentPreviewDesktopPath)) { |
| 47 | 47 | $newTitle = '<span class="flyntComponentPreview">'; |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | } else { |
| 56 | 56 | add_action('wp_enqueue_scripts', NS . 'enqueueComponentScripts'); |
| 57 | 57 | // adds Component Previews button to admin bar on front-end when logged in |
| 58 | - add_action('admin_bar_menu', function ($wpAdminBar) { |
|
| 58 | + add_action('admin_bar_menu', function($wpAdminBar) { |
|
| 59 | 59 | $title = __('Component Previews', 'flynt-starter-theme'); |
| 60 | 60 | $wpAdminBar->add_menu([ |
| 61 | 61 | 'id' => 'toggleComponentPreviews', |
@@ -12,10 +12,10 @@ discard block |
||
| 12 | 12 | // register all components |
| 13 | 13 | $componentPath = trailingslashit(Feature::getOption('flynt-components', 0)); |
| 14 | 14 | |
| 15 | -add_action('Flynt/afterRegisterFeatures', function () use ($componentPath) { |
|
| 15 | +add_action('Flynt/afterRegisterFeatures', function() use ($componentPath) { |
|
| 16 | 16 | if (is_dir($componentPath)) { |
| 17 | 17 | $components = []; |
| 18 | - FileLoader::iterateDir($componentPath, function ($dir) use (&$components) { |
|
| 18 | + FileLoader::iterateDir($componentPath, function($dir) use (&$components) { |
|
| 19 | 19 | if ($dir->isDir()) { |
| 20 | 20 | $components[] = $dir->getFilename(); |
| 21 | 21 | } |
@@ -26,6 +26,6 @@ discard block |
||
| 26 | 26 | }); |
| 27 | 27 | |
| 28 | 28 | // set Component Path |
| 29 | -add_filter('Flynt/componentPath', function ($defaultPath, $componentName) use ($componentPath) { |
|
| 29 | +add_filter('Flynt/componentPath', function($defaultPath, $componentName) use ($componentPath) { |
|
| 30 | 30 | return $componentPath . $componentName; |
| 31 | 31 | }, 10, 2); |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | { |
| 7 | 7 | public static function init() |
| 8 | 8 | { |
| 9 | - add_filter('acf/fields/google_map/api', function ($api) { |
|
| 9 | + add_filter('acf/fields/google_map/api', function($api) { |
|
| 10 | 10 | $apiKey = OptionPages::get('globalOptions', 'feature', 'Acf', 'googleMapsApiKey'); |
| 11 | 11 | if ($apiKey) { |
| 12 | 12 | $api['key'] = $apiKey; |
@@ -5,11 +5,11 @@ |
||
| 5 | 5 | use Flynt\Features\Components\Component; |
| 6 | 6 | use Timber\Menu; |
| 7 | 7 | |
| 8 | -add_action('wp_enqueue_scripts', function () { |
|
| 8 | +add_action('wp_enqueue_scripts', function() { |
|
| 9 | 9 | Component::enqueueAssets('NavigationMain'); |
| 10 | 10 | }); |
| 11 | 11 | |
| 12 | -add_filter('Flynt/addComponentData?name=NavigationMain', function ($data) { |
|
| 12 | +add_filter('Flynt/addComponentData?name=NavigationMain', function($data) { |
|
| 13 | 13 | // set max level of the menu |
| 14 | 14 | $data['maxLevel'] = 0; |
| 15 | 15 | $data['menuSlug'] = !empty($data['menuSlug']) ? $data['menuSlug'] : ''; |