@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | define(__NAMESPACE__ . '\NS', __NAMESPACE__ . '\\'); |
| 13 | 13 | |
| 14 | -add_action('Flynt/afterRegisterComponents', function () { |
|
| 14 | +add_action('Flynt/afterRegisterComponents', function() { |
|
| 15 | 15 | if (((defined('WP_ENV') && WP_ENV === 'development') || current_user_can('editor') || current_user_can('administrator')) && isset($_GET['log'])) { |
| 16 | 16 | if (isset($_GET['component']) && !empty($_GET['component'])) { |
| 17 | 17 | define(__NAMESPACE__ . '\COMPONENT_WHITELIST', explode(',', $_GET['component'])); |
@@ -38,21 +38,21 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | $type = gettype($data); |
| 40 | 40 | $output = json_encode($data); |
| 41 | - $result = "<script>console.log({$output});</script>\n"; |
|
| 41 | + $result = "<script>console.log({$output});</script>\n"; |
|
| 42 | 42 | echoDebug($result, $postpone); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | function consoleTable($data, $postpone = true) |
| 46 | 46 | { |
| 47 | 47 | $output = json_encode($data); |
| 48 | - $result = "<script>console.table({$output});</script>\n"; |
|
| 48 | + $result = "<script>console.table({$output});</script>\n"; |
|
| 49 | 49 | echoDebug($result, $postpone); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | function echoDebug($data, $postpone) |
| 53 | 53 | { |
| 54 | 54 | if ($postpone) { |
| 55 | - add_action('wp_footer', function () use ($data) { |
|
| 55 | + add_action('wp_footer', function() use ($data) { |
|
| 56 | 56 | echo $data; |
| 57 | 57 | }, 30); |
| 58 | 58 | } else { |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | |
| 30 | 30 | // Convert ACF Field of type relationship to a Timber\Post and add all ACF Fields of that Post |
| 31 | 31 | add_filter('acf/format_value/type=relationship', NS . 'formatPostObject', 100); |
| 32 | -add_filter('get_twig', function ($twig) { |
|
| 32 | +add_filter('get_twig', function($twig) { |
|
| 33 | 33 | $twig->addExtension(new TwigExtensionFlynt()); |
| 34 | 34 | return $twig; |
| 35 | 35 | }); |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | function formatGallery($value) |
| 46 | 46 | { |
| 47 | 47 | if (!empty($value)) { |
| 48 | - $value = array_map(function ($image) { |
|
| 48 | + $value = array_map(function($image) { |
|
| 49 | 49 | return new Image($image); |
| 50 | 50 | }, $value); |
| 51 | 51 | } |
@@ -70,8 +70,8 @@ discard block |
||
| 70 | 70 | return $value; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | -add_action('timber/twig/filters', function ($twig) { |
|
| 74 | - $twig->addFunction(new TwigFunction('placeholderImage', function ($width, $height, $color = null) { |
|
| 73 | +add_action('timber/twig/filters', function($twig) { |
|
| 74 | + $twig->addFunction(new TwigFunction('placeholderImage', function($width, $height, $color = null) { |
|
| 75 | 75 | $width = round($width); |
| 76 | 76 | $height = round($height); |
| 77 | 77 | $colorRect = $color ? "<rect width='{$width}' height='{$height}' style='fill:$color' />" : ''; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | return "data:image/svg+xml;base64," . base64_encode($svg); |
| 80 | 80 | })); |
| 81 | 81 | |
| 82 | - $twig->addFunction(new TwigFunction('requireUrl', function ($asset) { |
|
| 82 | + $twig->addFunction(new TwigFunction('requireUrl', function($asset) { |
|
| 83 | 83 | return Asset::requireUrl($asset); |
| 84 | 84 | })); |
| 85 | 85 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | // This prevents unintended scrolling on pages with few content, when logged in. |
| 24 | 24 | add_theme_support('admin-bar', array('callback' => '__return_false')); |
| 25 | 25 | |
| 26 | -add_action('after_setup_theme', function () { |
|
| 26 | +add_action('after_setup_theme', function() { |
|
| 27 | 27 | /** |
| 28 | 28 | * Make theme available for translation. |
| 29 | 29 | * Translations can be filed in the /languages/ directory. |
@@ -6,7 +6,7 @@ discard block |
||
| 6 | 6 | |
| 7 | 7 | namespace Flynt\RemoveEditor; |
| 8 | 8 | |
| 9 | -add_action('init', function () { |
|
| 9 | +add_action('init', function() { |
|
| 10 | 10 | remove_post_type_support('page', 'editor'); |
| 11 | 11 | remove_post_type_support('post', 'editor'); |
| 12 | 12 | }); |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * Removes Gutenberg default styles on front-end |
| 16 | 16 | */ |
| 17 | -add_action('wp_print_styles', function () { |
|
| 17 | +add_action('wp_print_styles', function() { |
|
| 18 | 18 | wp_dequeue_style('wp-block-library'); |
| 19 | 19 | wp_dequeue_style('wp-block-library-theme'); |
| 20 | 20 | }); |
@@ -6,13 +6,13 @@ |
||
| 6 | 6 | use Timber\Menu; |
| 7 | 7 | use Flynt\Shortcodes; |
| 8 | 8 | |
| 9 | -add_action('init', function () { |
|
| 9 | +add_action('init', function() { |
|
| 10 | 10 | register_nav_menus([ |
| 11 | 11 | 'navigation_footer' => __('Navigation Footer', 'flynt') |
| 12 | 12 | ]); |
| 13 | 13 | }); |
| 14 | 14 | |
| 15 | -add_filter('Flynt/addComponentData?name=NavigationFooter', function ($data) { |
|
| 15 | +add_filter('Flynt/addComponentData?name=NavigationFooter', function($data) { |
|
| 16 | 16 | $data['maxLevel'] = 0; |
| 17 | 17 | $data['menu'] = new Menu('navigation_footer'); |
| 18 | 18 | |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | /** |
| 10 | 10 | * Current year |
| 11 | 11 | */ |
| 12 | -add_shortcode('year', function () { |
|
| 12 | +add_shortcode('year', function() { |
|
| 13 | 13 | $year = date_i18n('Y'); |
| 14 | 14 | return $year; |
| 15 | 15 | }); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * Site Title |
| 19 | 19 | */ |
| 20 | -add_shortcode('sitetitle', function () { |
|
| 20 | +add_shortcode('sitetitle', function() { |
|
| 21 | 21 | $blogname = get_bloginfo('name'); |
| 22 | 22 | return $blogname; |
| 23 | 23 | }); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | /** |
| 26 | 26 | * Tagline |
| 27 | 27 | */ |
| 28 | -add_shortcode('tagline', function () { |
|
| 28 | +add_shortcode('tagline', function() { |
|
| 29 | 29 | $tagline = get_bloginfo('description'); |
| 30 | 30 | return $tagline; |
| 31 | 31 | }); |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | use ACFComposer\ACFComposer; |
| 4 | 4 | use Flynt\Components; |
| 5 | 5 | |
| 6 | -add_action('Flynt/afterRegisterComponents', function () { |
|
| 6 | +add_action('Flynt/afterRegisterComponents', function() { |
|
| 7 | 7 | ACFComposer::registerFieldGroup([ |
| 8 | 8 | 'name' => 'reusableComponents', |
| 9 | 9 | 'title' => 'Reusable Components', |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | ]; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -add_filter('acf/prepare_field/name=reusablePost', function ($field) { |
|
| 28 | +add_filter('acf/prepare_field/name=reusablePost', function($field) { |
|
| 29 | 29 | // Set initial instructions and update with selected post link |
| 30 | 30 | $reusableAdminLink = admin_url('edit.php?post_type=reusable-component'); |
| 31 | 31 | $postEditLink = get_edit_post_link($field['value']); |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | use Timber\Timber; |
| 8 | 8 | use Timber\Post; |
| 9 | 9 | |
| 10 | -add_filter('Flynt/addComponentData?name=BlockAnchor', function ($data) { |
|
| 10 | +add_filter('Flynt/addComponentData?name=BlockAnchor', function($data) { |
|
| 11 | 11 | if (isset($data['anchor'])) { |
| 12 | 12 | // convert to lowercase letters only |
| 13 | 13 | $data['anchor'] = preg_replace('/[^a-zA-Z]/', '', strtolower($data['anchor'])); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | ]; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | -add_filter('acf/load_field/name=anchorLinkCopy', function ($field) { |
|
| 46 | +add_filter('acf/load_field/name=anchorLinkCopy', function($field) { |
|
| 47 | 47 | global $post; |
| 48 | 48 | $post = new \Timber\Post($post); |
| 49 | 49 | $message = $field['message']; |