@@ -24,17 +24,17 @@ |
||
24 | 24 | return $classes; |
25 | 25 | } |
26 | 26 | |
27 | -add_filter('body_class', __NAMESPACE__ . '\\body_class'); |
|
27 | +add_filter('body_class', __NAMESPACE__.'\\body_class'); |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Clean up the_excerpt() |
31 | 31 | */ |
32 | 32 | function excerpt_more() |
33 | 33 | { |
34 | - return ' … <a href="' . get_permalink() . '">' . __('Continued', 'stash') . '</a>'; |
|
34 | + return ' … <a href="'.get_permalink().'">'.__('Continued', 'stash').'</a>'; |
|
35 | 35 | } |
36 | 36 | |
37 | -add_filter('excerpt_more', __NAMESPACE__ . '\\excerpt_more'); |
|
37 | +add_filter('excerpt_more', __NAMESPACE__.'\\excerpt_more'); |
|
38 | 38 | |
39 | 39 | function dd($var) |
40 | 40 | { |
@@ -12,35 +12,35 @@ |
||
12 | 12 | */ |
13 | 13 | public function load() |
14 | 14 | { |
15 | - $vendorJsExists = file_exists(get_template_directory() . '/dist/js/vendor.js'); |
|
16 | - $mainJsExists = file_exists(get_template_directory() . '/dist/js/main.js'); |
|
15 | + $vendorJsExists = file_exists(get_template_directory().'/dist/js/vendor.js'); |
|
16 | + $mainJsExists = file_exists(get_template_directory().'/dist/js/main.js'); |
|
17 | 17 | $mainJsDependencies = []; |
18 | 18 | |
19 | - $mainCssExists = file_exists(get_template_directory() . '/dist/css/main.css'); |
|
20 | - $vendorCssExists = file_exists(get_template_directory() . '/dist/css/vendor.css'); |
|
19 | + $mainCssExists = file_exists(get_template_directory().'/dist/css/main.css'); |
|
20 | + $vendorCssExists = file_exists(get_template_directory().'/dist/css/vendor.css'); |
|
21 | 21 | $mainCssDependencies = []; |
22 | 22 | |
23 | 23 | if ($vendorJsExists) { |
24 | - wp_enqueue_script('stashVendorJs', get_template_directory_uri() . '/dist/js/vendor.js', [], filemtime(get_stylesheet_directory() . '/dist/js/vendor.js'), true); |
|
24 | + wp_enqueue_script('stashVendorJs', get_template_directory_uri().'/dist/js/vendor.js', [], filemtime(get_stylesheet_directory().'/dist/js/vendor.js'), true); |
|
25 | 25 | array_push($mainJsDependencies, 'stashVendorJs'); |
26 | 26 | } |
27 | 27 | |
28 | 28 | if ($mainJsExists) { |
29 | - wp_enqueue_script('stashMainJs', get_template_directory_uri() . '/dist/js/main.js', $mainJsDependencies, filemtime(get_stylesheet_directory() . '/dist/js/main.js'), true); |
|
29 | + wp_enqueue_script('stashMainJs', get_template_directory_uri().'/dist/js/main.js', $mainJsDependencies, filemtime(get_stylesheet_directory().'/dist/js/main.js'), true); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | if ($vendorCssExists) { |
33 | - wp_enqueue_style('stashVendorCss', get_template_directory_uri() . '/dist/css/vendor.css', [], filemtime(get_stylesheet_directory() . '/dist/css/vendor.css')); |
|
33 | + wp_enqueue_style('stashVendorCss', get_template_directory_uri().'/dist/css/vendor.css', [], filemtime(get_stylesheet_directory().'/dist/css/vendor.css')); |
|
34 | 34 | array_push($mainCssDependencies, 'stashVendorCss'); |
35 | 35 | } |
36 | 36 | |
37 | 37 | if ($mainCssExists) { |
38 | - wp_enqueue_style('stashMainCss', get_template_directory_uri() . '/dist/css/main.css', $mainCssDependencies, filemtime(get_stylesheet_directory() . '/dist/css/main.css')); |
|
38 | + wp_enqueue_style('stashMainCss', get_template_directory_uri().'/dist/css/main.css', $mainCssDependencies, filemtime(get_stylesheet_directory().'/dist/css/main.css')); |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
43 | -add_action('wp_enqueue_scripts', function () { |
|
43 | +add_action('wp_enqueue_scripts', function() { |
|
44 | 44 | $assets = new Assets(); |
45 | 45 | $assets->load(); |
46 | 46 | }, 100); |
47 | 47 | \ No newline at end of file |
@@ -82,12 +82,12 @@ |
||
82 | 82 | |
83 | 83 | $transientHelper = new TransientHelper(); |
84 | 84 | |
85 | -add_action('post_updated', function () use ($transientHelper) { |
|
85 | +add_action('post_updated', function() use ($transientHelper) { |
|
86 | 86 | $transientHelper->deleteAll(); |
87 | 87 | }); |
88 | -add_action('save_post', function () use ($transientHelper) { |
|
88 | +add_action('save_post', function() use ($transientHelper) { |
|
89 | 89 | $transientHelper->deleteAll(); |
90 | 90 | }); |
91 | -add_action('add_attachment', function () use ($transientHelper) { |
|
91 | +add_action('add_attachment', function() use ($transientHelper) { |
|
92 | 92 | $transientHelper->deleteAll(); |
93 | 93 | }); |
94 | 94 | \ No newline at end of file |
@@ -8,14 +8,14 @@ |
||
8 | 8 | $labels = array( |
9 | 9 | 'name' => _x($plural, 'taxonomy general name', 'stash'), |
10 | 10 | 'singular_name' => _x($single, 'taxonomy singular name', 'stash'), |
11 | - 'search_items' => __('Search ' . $plural, 'stash'), |
|
11 | + 'search_items' => __('Search '.$plural, 'stash'), |
|
12 | 12 | 'all_items' => __('All Genres', 'stash'), |
13 | - 'parent_item' => __('Parent ' . $single, 'stash'), |
|
14 | - 'parent_item_colon' => __('Parent :' . $single, 'stash'), |
|
15 | - 'edit_item' => __('Edit ' . $single, 'stash'), |
|
16 | - 'update_item' => __('Update ' . $single, 'stash'), |
|
17 | - 'add_new_item' => __('Add New ' . $single, 'stash'), |
|
18 | - 'new_item_name' => __('New ' . $single . ' Name', 'stash'), |
|
13 | + 'parent_item' => __('Parent '.$single, 'stash'), |
|
14 | + 'parent_item_colon' => __('Parent :'.$single, 'stash'), |
|
15 | + 'edit_item' => __('Edit '.$single, 'stash'), |
|
16 | + 'update_item' => __('Update '.$single, 'stash'), |
|
17 | + 'add_new_item' => __('Add New '.$single, 'stash'), |
|
18 | + 'new_item_name' => __('New '.$single.' Name', 'stash'), |
|
19 | 19 | 'menu_name' => __($single, 'stash'), |
20 | 20 | ); |
21 | 21 |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | */ |
12 | 12 | function get($name) |
13 | 13 | { |
14 | - return get_template_directory_uri() . '/dist/images/' . $name; |
|
14 | + return get_template_directory_uri().'/dist/images/'.$name; |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | /** |
@@ -22,12 +22,12 @@ discard block |
||
22 | 22 | */ |
23 | 23 | function fetch($name) |
24 | 24 | { |
25 | - return get_stylesheet_directory() . '/dist/images/' . $name; |
|
25 | + return get_stylesheet_directory().'/dist/images/'.$name; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | function display($name) |
29 | 29 | { |
30 | - return "<img src='" . $this->get($name) . "' />"; |
|
30 | + return "<img src='".$this->get($name)."' />"; |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
@@ -6,8 +6,8 @@ |
||
6 | 6 | */ |
7 | 7 | |
8 | 8 | if (!class_exists('Timber')) { |
9 | - add_action('admin_notices', function () { |
|
10 | - echo '<div class="error"><p>Timber not activated. Make sure you activate the plugin in <a href="' . esc_url(admin_url('plugins.php#timber')) . '">' . esc_url(admin_url('plugins.php')) . '</a></p></div>'; |
|
9 | + add_action('admin_notices', function() { |
|
10 | + echo '<div class="error"><p>Timber not activated. Make sure you activate the plugin in <a href="'.esc_url(admin_url('plugins.php#timber')).'">'.esc_url(admin_url('plugins.php')).'</a></p></div>'; |
|
11 | 11 | }); |
12 | 12 | |
13 | 13 | return; |
@@ -6,15 +6,15 @@ |
||
6 | 6 | * Add or remove files to the array as needed. Supports child theme overrides. |
7 | 7 | */ |
8 | 8 | $stash_includes = [ |
9 | - 'lib/cache.php', // Cache |
|
9 | + 'lib/cache.php', // Cache |
|
10 | 10 | 'lib/controller.php', // Controller setup |
11 | - 'lib/timber.php', // Twig magic |
|
12 | - 'lib/assets.php', // Scripts and stylesheets |
|
13 | - 'lib/extras.php', // Custom functions |
|
14 | - 'lib/setup.php', // Theme setup |
|
15 | - 'lib/images.php', // Helper for retrieving Images |
|
16 | - 'lib/custom.php', // Load custom post types and taxonomies |
|
17 | - 'lib/acf.php', // Functions related to ACF |
|
11 | + 'lib/timber.php', // Twig magic |
|
12 | + 'lib/assets.php', // Scripts and stylesheets |
|
13 | + 'lib/extras.php', // Custom functions |
|
14 | + 'lib/setup.php', // Theme setup |
|
15 | + 'lib/images.php', // Helper for retrieving Images |
|
16 | + 'lib/custom.php', // Load custom post types and taxonomies |
|
17 | + 'lib/acf.php', // Functions related to ACF |
|
18 | 18 | 'lib/transients.php', // Clear all transients on database changes |
19 | 19 | ]; |
20 | 20 |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | /** |
72 | 72 | * See if controller excists else fall back to default |
73 | 73 | */ |
74 | - $file = get_template_directory() . '/controllers/' . $page . '.php'; |
|
74 | + $file = get_template_directory().'/controllers/'.$page.'.php'; |
|
75 | 75 | if (file_exists($file)) { |
76 | 76 | $this->found = $page; |
77 | 77 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | { |
100 | 100 | $this->setContext(); |
101 | 101 | $context = $this->context; |
102 | - Timber::render(['page-' . $this->context['post']->post_name . '.twig', 'page.twig'], $this->context, Cache::getTimerTime()); |
|
102 | + Timber::render(['page-'.$this->context['post']->post_name.'.twig', 'page.twig'], $this->context, Cache::getTimerTime()); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | public function getClass() |
111 | 111 | { |
112 | 112 | if ($this->found) { |
113 | - return 'page-' . $this->found; |
|
113 | + return 'page-'.$this->found; |
|
114 | 114 | } else { |
115 | 115 | return false; |
116 | 116 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | ]); |
14 | 14 | } |
15 | 15 | |
16 | -add_action('init', __NAMESPACE__ . '\\setControllers'); |
|
16 | +add_action('init', __NAMESPACE__.'\\setControllers'); |
|
17 | 17 | |
18 | 18 | function setup() |
19 | 19 | { |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | |
28 | 28 | // Make theme available for translation |
29 | 29 | // Community translations can be found at https://github.com/roots/sage-translations |
30 | - load_theme_textdomain('stash', get_template_directory() . '/lang'); |
|
30 | + load_theme_textdomain('stash', get_template_directory().'/lang'); |
|
31 | 31 | |
32 | 32 | // Enable plugins to manage the document title |
33 | 33 | // http://codex.wordpress.org/Function_Reference/add_theme_support#Title_Tag |
@@ -56,4 +56,4 @@ discard block |
||
56 | 56 | add_theme_support('menus'); |
57 | 57 | } |
58 | 58 | |
59 | -add_action('after_setup_theme', __NAMESPACE__ . '\\setup'); |
|
59 | +add_action('after_setup_theme', __NAMESPACE__.'\\setup'); |