@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | public static function setTemplateDirectory() |
| 44 | 44 | { |
| 45 | - add_action('after_switch_theme', function () { |
|
| 45 | + add_action('after_switch_theme', function() { |
|
| 46 | 46 | $stylesheet = get_option('stylesheet'); |
| 47 | 47 | |
| 48 | 48 | if (basename($stylesheet) !== 'templates') { |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | } |
| 51 | 51 | }); |
| 52 | 52 | |
| 53 | - add_filter('stylesheet', function ($stylesheet) { |
|
| 53 | + add_filter('stylesheet', function($stylesheet) { |
|
| 54 | 54 | return dirname($stylesheet); |
| 55 | 55 | }); |
| 56 | 56 | } |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | if (!$acfActive || !$flyntCoreActive) { |
| 72 | - add_filter('template_include', function () { |
|
| 72 | + add_filter('template_include', function() { |
|
| 73 | 73 | die( |
| 74 | 74 | 'One or more required plugins are not activated! Please <a href="' |
| 75 | 75 | . esc_url(admin_url('plugins.php')) |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | protected static function notifyRequiredPluginIsMissing($pluginName) |
| 85 | 85 | { |
| 86 | - add_action('admin_notices', function () use ($pluginName) { |
|
| 86 | + add_action('admin_notices', function() use ($pluginName) { |
|
| 87 | 87 | echo "<div class=\"error\"><p>${pluginName} Plugin not activated. Make sure you activate the plugin on the <a href=\"" |
| 88 | 88 | . esc_url(admin_url('plugins.php')) . "\">plugin page</a>.</p></div>"; |
| 89 | 89 | }); |
@@ -149,10 +149,10 @@ |
||
| 149 | 149 | } |
| 150 | 150 | if ($type === 'style') { |
| 151 | 151 | global $wp_styles; |
| 152 | - $repo =& $wp_styles; |
|
| 152 | + $repo = & $wp_styles; |
|
| 153 | 153 | } else { |
| 154 | 154 | global $wp_scripts; |
| 155 | - $repo =& $wp_scripts; |
|
| 155 | + $repo = & $wp_scripts; |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | $asset = $repo->query($handle, 'registered'); |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | } |
| 14 | 14 | |
| 15 | 15 | // collect script dependencies |
| 16 | - $scriptDeps = array_reduce($dependencies, function ($list, $dependency) { |
|
| 16 | + $scriptDeps = array_reduce($dependencies, function($list, $dependency) { |
|
| 17 | 17 | if ($dependency['type'] === 'script') { |
| 18 | 18 | array_push($list, $dependency['name']); |
| 19 | 19 | } |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | }, []); // jquery as a default dependency |
| 22 | 22 | |
| 23 | 23 | // collect style dependencies |
| 24 | - $styleDeps = array_reduce($dependencies, function ($list, $dependency) { |
|
| 24 | + $styleDeps = array_reduce($dependencies, function($list, $dependency) { |
|
| 25 | 25 | if ($dependency['type'] === 'style') { |
| 26 | 26 | array_push($list, $dependency['name']); |
| 27 | 27 | } |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | }, []); |
| 30 | 30 | |
| 31 | 31 | if (!empty($scriptDeps) || !empty($styleDeps)) { |
| 32 | - add_action('wp_enqueue_scripts', function () use ($scriptDeps, $styleDeps) { |
|
| 32 | + add_action('wp_enqueue_scripts', function() use ($scriptDeps, $styleDeps) { |
|
| 33 | 33 | Asset::addDependencies('Flynt/assets', $scriptDeps); |
| 34 | 34 | Asset::addDependencies('Flynt/assets', $styleDeps, 'style'); |
| 35 | 35 | }, 11); |
@@ -5,7 +5,7 @@ discard block |
||
| 5 | 5 | |
| 6 | 6 | define(__NAMESPACE__ . '\NS', __NAMESPACE__ . '\\'); |
| 7 | 7 | |
| 8 | -add_action('wp_enqueue_scripts', function () { |
|
| 8 | +add_action('wp_enqueue_scripts', function() { |
|
| 9 | 9 | if (is_user_logged_in()) { |
| 10 | 10 | Asset::register([ |
| 11 | 11 | 'type' => 'script', |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | wp_localize_script('Flynt/assets/auth', 'wpData', $data); |
| 21 | 21 | }); |
| 22 | 22 | |
| 23 | -add_action('wp_admin_enqueue_scripts', function () { |
|
| 23 | +add_action('wp_admin_enqueue_scripts', function() { |
|
| 24 | 24 | $data = [ |
| 25 | 25 | 'templateDirectoryUri' => get_template_directory_uri() . '/dist', |
| 26 | 26 | ]; |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | if (is_user_logged_in() || is_admin()) { |
| 32 | 32 | if (is_admin()) { |
| 33 | 33 | // add image to the flexible content component name |
| 34 | - add_filter('acf/fields/flexible_content/layout_title', function ($title, $field, $layout, $i) { |
|
| 34 | + add_filter('acf/fields/flexible_content/layout_title', function($title, $field, $layout, $i) { |
|
| 35 | 35 | $componentName = ucfirst($layout['name']); |
| 36 | 36 | $componentPath = "Components/{$componentName}"; |
| 37 | 37 | $componentPreviewDesktopPath = Asset::requirePath("{$componentPath}/preview-desktop.jpg"); |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | }, 11, 4); |
| 48 | 48 | } else { |
| 49 | 49 | // adds Component Previews button to admin bar on front-end when logged in |
| 50 | - add_action('admin_bar_menu', function ($wpAdminBar) { |
|
| 50 | + add_action('admin_bar_menu', function($wpAdminBar) { |
|
| 51 | 51 | $title = __('Component Previews', 'flynt-starter-theme'); |
| 52 | 52 | $wpAdminBar->add_node([ |
| 53 | 53 | 'id' => 'toggleComponentPreviews', |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -add_action('after_setup_theme', function () { |
|
| 3 | +add_action('after_setup_theme', function() { |
|
| 4 | 4 | add_theme_support('title-tag'); |
| 5 | 5 | add_theme_support('post-thumbnails'); |
| 6 | 6 | }); |
@@ -2,7 +2,7 @@ discard block |
||
| 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', |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | } |
| 62 | 62 | }); |
| 63 | 63 | |
| 64 | -add_action('admin_enqueue_scripts', function () { |
|
| 64 | +add_action('admin_enqueue_scripts', function() { |
|
| 65 | 65 | Asset::enqueue([ |
| 66 | 66 | 'name' => 'Flynt/assets/admin', |
| 67 | 67 | 'path' => 'assets/admin.js', |