@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | use ACFComposer\ACFComposer; |
| 4 | 4 | |
| 5 | -add_action('acf/init', function () { |
|
| 5 | +add_action('acf/init', function() { |
|
| 6 | 6 | ACFComposer::registerFieldGroup([ |
| 7 | 7 | 'name' => 'pageComponents', |
| 8 | 8 | 'title' => 'Page Components', |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | use ACFComposer\ACFComposer; |
| 4 | 4 | |
| 5 | -add_action('acf/init', function () { |
|
| 5 | +add_action('acf/init', function() { |
|
| 6 | 6 | ACFComposer::registerFieldGroup([ |
| 7 | 7 | 'name' => 'postComponents', |
| 8 | 8 | 'title' => 'Post Components', |
@@ -29,6 +29,9 @@ |
||
| 29 | 29 | return $output; |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | + /** |
|
| 33 | + * @param string $componentName |
|
| 34 | + */ |
|
| 32 | 35 | public function renderComponent(Twig_Environment $env, $context, $componentName, $data = [], $withContext = true, $ignoreMissing = false, $sandboxed = false) |
| 33 | 36 | { |
| 34 | 37 | $data = $this->getComponentData($data, $componentName); |
@@ -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 | die( |
| 38 | 38 | 'One or more required plugins are not activated! Please <a href="' |
| 39 | 39 | . esc_url(admin_url('plugins.php')) |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | protected static function notifyRequiredPluginIsMissing($pluginName) |
| 49 | 49 | { |
| 50 | - add_action('admin_notices', function () use ($pluginName) { |
|
| 50 | + add_action('admin_notices', function() use ($pluginName) { |
|
| 51 | 51 | echo "<div class=\"error\"><p>${pluginName} Plugin not activated. Make sure you activate the plugin on the <a href=\"" |
| 52 | 52 | . esc_url(admin_url('plugins.php')) . "\">plugin page</a>.</p></div>"; |
| 53 | 53 | }); |
@@ -2,7 +2,7 @@ |
||
| 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::register([ |
| 7 | 7 | 'name' => 'console-polyfill', |
| 8 | 8 | 'type' => 'script', |
@@ -7,19 +7,19 @@ discard block |
||
| 7 | 7 | use Timber\Menu; |
| 8 | 8 | use Flynt\Features\Acf\OptionPages; |
| 9 | 9 | |
| 10 | -add_action('wp_enqueue_scripts', function () { |
|
| 10 | +add_action('wp_enqueue_scripts', function() { |
|
| 11 | 11 | Component::enqueueAssets('NavigationMain'); |
| 12 | 12 | }); |
| 13 | 13 | |
| 14 | -add_filter('Flynt/addComponentData?name=NavigationMain', function ($data) { |
|
| 14 | +add_filter('Flynt/addComponentData?name=NavigationMain', function($data) { |
|
| 15 | 15 | // set max level of the menu |
| 16 | 16 | $data['maxLevel'] = 0; |
| 17 | 17 | $data['menuSlug'] = !empty($data['menuSlug']) ? $data['menuSlug'] : 'navigation_main'; |
| 18 | 18 | $data['menu'] = has_nav_menu($data['menuSlug']) ? new Menu($data['menuSlug']) : false; |
| 19 | 19 | |
| 20 | 20 | if (!empty($data['menu'])) { |
| 21 | - $data['menu']->items = array_map(function ($item) { |
|
| 22 | - $item->btnClasses = array_filter($item->classes, function ($class) { |
|
| 21 | + $data['menu']->items = array_map(function($item) { |
|
| 22 | + $item->btnClasses = array_filter($item->classes, function($class) { |
|
| 23 | 23 | return stripos(trim($class), 'btn') === 0; |
| 24 | 24 | }); |
| 25 | 25 | $item->classes = array_diff($item->classes, $item->btnClasses); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | return $data; |
| 33 | 33 | }); |
| 34 | 34 | |
| 35 | -add_action('init', function () { |
|
| 35 | +add_action('init', function() { |
|
| 36 | 36 | register_nav_menus([ |
| 37 | 37 | 'navigation_main' => __('Navigation Main', 'flynt-starter-theme') |
| 38 | 38 | ]); |
@@ -4,11 +4,11 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Flynt\Utils\Component; |
| 6 | 6 | |
| 7 | -add_filter('Flynt/addComponentData?name=GridDownloadPortrait', function ($data) { |
|
| 7 | +add_filter('Flynt/addComponentData?name=GridDownloadPortrait', function($data) { |
|
| 8 | 8 | Component::enqueueAssets('GridDownloadPortrait'); |
| 9 | 9 | |
| 10 | 10 | if (!empty($data['items'])) { |
| 11 | - $data['items'] = array_map(function ($item) { |
|
| 11 | + $data['items'] = array_map(function($item) { |
|
| 12 | 12 | if ($item['itemType'] === 'itemFile') { |
| 13 | 13 | $fileSize = filesize(get_attached_file($item['file']['id'])); |
| 14 | 14 | $item['file']['fileSize'] = size_format($fileSize); |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Flynt\Utils\Component; |
| 6 | 6 | |
| 7 | -add_filter('Flynt/addComponentData?name=GridContentLists', function ($data) { |
|
| 7 | +add_filter('Flynt/addComponentData?name=GridContentLists', function($data) { |
|
| 8 | 8 | Component::enqueueAssets('GridContentLists'); |
| 9 | 9 | |
| 10 | 10 | return $data; |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Flynt\Utils\Component; |
| 6 | 6 | |
| 7 | -add_filter('Flynt/addComponentData?name=HeroCta', function ($data) { |
|
| 7 | +add_filter('Flynt/addComponentData?name=HeroCta', function($data) { |
|
| 8 | 8 | Component::enqueueAssets('HeroCta'); |
| 9 | 9 | |
| 10 | 10 | return $data; |