@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | use Flynt\Features\Acf\OptionPages; |
| 6 | 6 | |
| 7 | -add_filter('Flynt/addComponentData?name=ComponentLoaderFlexible', function ($data) { |
|
| 7 | +add_filter('Flynt/addComponentData?name=ComponentLoaderFlexible', function($data) { |
|
| 8 | 8 | $optionPage = (array_key_exists('optionPage', $data)) ? $data['optionPage'] : []; |
| 9 | 9 | if (is_array($optionPage) && |
| 10 | 10 | array_key_exists('optionType', $optionPage) && |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | return $data; |
| 22 | 22 | }); |
| 23 | 23 | |
| 24 | -add_filter('Flynt/dynamicSubcomponents?name=ComponentLoaderFlexible', function ($areas, $data, $parentData) { |
|
| 24 | +add_filter('Flynt/dynamicSubcomponents?name=ComponentLoaderFlexible', function($areas, $data, $parentData) { |
|
| 25 | 25 | $fieldGroup = $data['fieldGroup']; |
| 26 | 26 | if (array_key_exists($fieldGroup, $data) && |
| 27 | 27 | $data[$fieldGroup] !== false |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $fieldGroupData = $parentData['post']->fields[$fieldGroup]; |
| 34 | 34 | } |
| 35 | 35 | if (isset($fieldGroupData)) { |
| 36 | - $areas['components'] = array_map(function ($field) use ($parentData) { |
|
| 36 | + $areas['components'] = array_map(function($field) use ($parentData) { |
|
| 37 | 37 | return [ |
| 38 | 38 | 'name' => ucfirst($field['acf_fc_layout']), |
| 39 | 39 | 'customData' => $field, |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | // Filter out other (non-flynt) theme features |
| 87 | - $flyntThemeFeatures = array_filter($GLOBALS['_wp_theme_features'], function ($feature) { |
|
| 87 | + $flyntThemeFeatures = array_filter($GLOBALS['_wp_theme_features'], function($feature) { |
|
| 88 | 88 | return StringHelpers::startsWith('flynt-', $feature); |
| 89 | 89 | }, ARRAY_FILTER_USE_KEY); |
| 90 | 90 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | if (count($files) === 0) { |
| 45 | 45 | $dir = get_template_directory() . '/' . $dir; |
| 46 | 46 | |
| 47 | - self::iterateDir($dir, function ($file) { |
|
| 47 | + self::iterateDir($dir, function($file) { |
|
| 48 | 48 | if ($file->isDir()) { |
| 49 | 49 | $dirPath = trim(str_replace(get_template_directory(), '', $file->getPathname()), '/'); |
| 50 | 50 | self::loadPhpFiles($dirPath); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | }); |
| 56 | 56 | } else { |
| 57 | - array_walk($files, function ($file) use ($dir) { |
|
| 57 | + array_walk($files, function($file) use ($dir) { |
|
| 58 | 58 | $filePath = $dir . '/' . ltrim($file, '/'); |
| 59 | 59 | |
| 60 | 60 | if (!locate_template($filePath, true, true)) { |
@@ -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', |