@@ -6,7 +6,7 @@ |
||
| 6 | 6 | use Flynt\Utils\Options; |
| 7 | 7 | use Timber\Timber; |
| 8 | 8 | |
| 9 | -add_filter('Flynt/addComponentData?name=ListSearchResults', function ($data) { |
|
| 9 | +add_filter('Flynt/addComponentData?name=ListSearchResults', function($data) { |
|
| 10 | 10 | $data['prevIcon'] = Asset::getContents('Components/ListSearchResults/Assets/navigation-prev.svg'); |
| 11 | 11 | $data['nextIcon'] = Asset::getContents('Components/ListSearchResults/Assets/navigation-next.svg'); |
| 12 | 12 | $data['searchIcon'] = Asset::getContents('Components/ListSearchResults/Assets/search.svg'); |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | add_filter('the_password_form', function ($output) { |
| 9 | 9 | $context = Timber::get_context(); |
| 10 | 10 | $context['form'] = [ |
| 11 | - 'url' => site_url('/wp-login.php?action=postpass', 'login_post') |
|
| 11 | + 'url' => site_url('/wp-login.php?action=postpass', 'login_post') |
|
| 12 | 12 | ]; |
| 13 | 13 | |
| 14 | 14 | return Timber::fetch('index.twig', $context); |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Timber\Timber; |
| 6 | 6 | use Timber\Post; |
| 7 | 7 | |
| 8 | -add_filter('the_password_form', function ($output) { |
|
| 8 | +add_filter('the_password_form', function($output) { |
|
| 9 | 9 | $context = Timber::get_context(); |
| 10 | 10 | $context['form'] = [ |
| 11 | 11 | 'url' => site_url('/wp-login.php?action=postpass', 'login_post') |
@@ -4,13 +4,13 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Timber\Menu; |
| 6 | 6 | |
| 7 | -add_action('init', function () { |
|
| 7 | +add_action('init', function() { |
|
| 8 | 8 | register_nav_menus([ |
| 9 | 9 | 'navigation_footer' => __('Navigation Footer', 'flynt') |
| 10 | 10 | ]); |
| 11 | 11 | }); |
| 12 | 12 | |
| 13 | -add_filter('Flynt/addComponentData?name=NavigationFooter', function ($data) { |
|
| 13 | +add_filter('Flynt/addComponentData?name=NavigationFooter', function($data) { |
|
| 14 | 14 | $data['maxLevel'] = 0; |
| 15 | 15 | $data['menu'] = new Menu('navigation_footer'); |
| 16 | 16 | |
@@ -4,9 +4,9 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Flynt\Api; |
| 6 | 6 | |
| 7 | -add_filter('Flynt/addComponentData?name=GridDownloadPortrait', function ($data) { |
|
| 7 | +add_filter('Flynt/addComponentData?name=GridDownloadPortrait', function($data) { |
|
| 8 | 8 | if (!empty($data['items'])) { |
| 9 | - $data['items'] = array_map(function ($item) { |
|
| 9 | + $data['items'] = array_map(function($item) { |
|
| 10 | 10 | if ($item['itemType'] === 'itemFile') { |
| 11 | 11 | $fileSize = filesize(get_attached_file($item['file']['id'])); |
| 12 | 12 | $item['file']['fileSize'] = size_format($fileSize); |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | use Flynt\Api; |
| 5 | 5 | use Timber\Timber; |
| 6 | 6 | |
| 7 | -add_filter('Flynt/addComponentData?name=ListPostCards', function ($data) { |
|
| 7 | +add_filter('Flynt/addComponentData?name=ListPostCards', function($data) { |
|
| 8 | 8 | $posts = Timber::get_posts([ |
| 9 | 9 | 'post_type' => 'post', |
| 10 | 10 | 'posts_per_page' => 4, |
@@ -6,11 +6,11 @@ discard block |
||
| 6 | 6 | use Flynt\ComponentManager; |
| 7 | 7 | use Flynt\Utils\Asset; |
| 8 | 8 | |
| 9 | -add_filter('Flynt/addComponentData?name=ListComponents', function ($data) { |
|
| 9 | +add_filter('Flynt/addComponentData?name=ListComponents', function($data) { |
|
| 10 | 10 | if (!empty($data['componentBlocks'])) { |
| 11 | - $data['componentBlocks'] = array_map(function ($block) { |
|
| 11 | + $data['componentBlocks'] = array_map(function($block) { |
|
| 12 | 12 | $componentPaths = explode('/', $block['component']); |
| 13 | - $block['component'] = implode('/', array_slice($componentPaths, count($componentPaths)-3, 3)); |
|
| 13 | + $block['component'] = implode('/', array_slice($componentPaths, count($componentPaths) - 3, 3)); |
|
| 14 | 14 | |
| 15 | 15 | if (file_exists(Asset::requirePath($block['component'] . 'screenshot.png'))) { |
| 16 | 16 | $src = Asset::requireUrl($block['component'] . 'screenshot.png'); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | }); |
| 37 | 37 | |
| 38 | 38 | |
| 39 | -add_filter('acf/load_field/name=component', function ($field) { |
|
| 39 | +add_filter('acf/load_field/name=component', function($field) { |
|
| 40 | 40 | $componentManager = ComponentManager::getInstance(); |
| 41 | 41 | $field['choices'] = array_flip($componentManager->getAll()); |
| 42 | 42 | return $field; |
@@ -5,13 +5,13 @@ |
||
| 5 | 5 | use Timber\Menu; |
| 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['maxLevel'] = 0; |
| 16 | 16 | $data['menu'] = new Menu('navigation_main'); |
| 17 | 17 | |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Flynt\Api; |
| 6 | 6 | use Timber\Timber; |
| 7 | 7 | |
| 8 | -add_filter('Flynt/addComponentData?name=GridPostsSlider', function ($data) { |
|
| 8 | +add_filter('Flynt/addComponentData?name=GridPostsSlider', function($data) { |
|
| 9 | 9 | $posts = Timber::get_posts([ |
| 10 | 10 | 'post_type' => 'post', |
| 11 | 11 | 'posts_per_page' => -1, |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | |
| 4 | 4 | use Flynt\Utils\Asset; |
| 5 | 5 | |
| 6 | -add_action('admin_enqueue_scripts', function () { |
|
| 6 | +add_action('admin_enqueue_scripts', function() { |
|
| 7 | 7 | $data = [ |
| 8 | 8 | 'templateDirectoryUri' => get_template_directory_uri() . '/dist', |
| 9 | 9 | ]; |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | if (class_exists('acf')) { |
| 14 | 14 | if (is_admin()) { |
| 15 | 15 | // add image to the flexible content component name |
| 16 | - add_filter('acf/fields/flexible_content/layout_title', function ($title, $field, $layout, $i) { |
|
| 16 | + add_filter('acf/fields/flexible_content/layout_title', function($title, $field, $layout, $i) { |
|
| 17 | 17 | $componentName = ucfirst($layout['name']); |
| 18 | 18 | $componentPath = "Components/{$componentName}"; |
| 19 | 19 | $componentScreenshotPath = Asset::requirePath("{$componentPath}/screenshot.png"); |