@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | self::$_single = $this; |
55 | - self::$relative_path = '/../' . basename(__DIR__); |
|
55 | + self::$relative_path = '/../'.basename(__DIR__); |
|
56 | 56 | |
57 | 57 | if (is_admin()) { |
58 | 58 | add_filter('show_advanced_plugins', [$this, 'showInAdmin'], 0, 2); |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | $this->validatePlugins(); |
71 | 71 | $this->countPlugins(); |
72 | 72 | |
73 | - array_map(static function () { |
|
74 | - include_once(WPMU_PLUGIN_DIR . '/' . func_get_args()[0]); |
|
73 | + array_map(static function() { |
|
74 | + include_once(WPMU_PLUGIN_DIR.'/'.func_get_args()[0]); |
|
75 | 75 | }, array_keys(self::$cache['plugins'])); |
76 | 76 | |
77 | 77 | $this->pluginHooks(); |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | |
96 | 96 | $this->updateCache(); |
97 | 97 | |
98 | - self::$auto_plugins = array_map(function ($auto_plugin) { |
|
98 | + self::$auto_plugins = array_map(function($auto_plugin) { |
|
99 | 99 | $auto_plugin['Name'] .= ' *'; |
100 | 100 | |
101 | 101 | return $auto_plugin; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | */ |
130 | 130 | private function updateCache() |
131 | 131 | { |
132 | - require_once(ABSPATH . 'wp-admin/includes/plugin.php'); |
|
132 | + require_once(ABSPATH.'wp-admin/includes/plugin.php'); |
|
133 | 133 | |
134 | 134 | self::$auto_plugins = get_plugins(self::$relative_path); |
135 | 135 | self::$mu_plugins = get_mu_plugins(); |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | } |
154 | 154 | |
155 | 155 | foreach (self::$activated as $plugin_file => $plugin_info) { |
156 | - do_action('activate_' . $plugin_file); |
|
156 | + do_action('activate_'.$plugin_file); |
|
157 | 157 | } |
158 | 158 | } |
159 | 159 | |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | private function validatePlugins() |
164 | 164 | { |
165 | 165 | foreach (self::$cache['plugins'] as $plugin_file => $plugin_info) { |
166 | - if (!file_exists(WPMU_PLUGIN_DIR . '/' . $plugin_file)) { |
|
166 | + if (!file_exists(WPMU_PLUGIN_DIR.'/'.$plugin_file)) { |
|
167 | 167 | $this->updateCache(); |
168 | 168 | break; |
169 | 169 | } |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | return self::$count; |
185 | 185 | } |
186 | 186 | |
187 | - $count = count(glob(WPMU_PLUGIN_DIR . '/*/', GLOB_ONLYDIR | GLOB_NOSORT)); |
|
187 | + $count = count(glob(WPMU_PLUGIN_DIR.'/*/', GLOB_ONLYDIR | GLOB_NOSORT)); |
|
188 | 188 | |
189 | 189 | if (!isset(self::$cache['count']) || $count != self::$cache['count']) { |
190 | 190 | self::$count = $count; |
@@ -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 | /** |
@@ -2,19 +2,19 @@ |
||
2 | 2 | |
3 | 3 | $context['title'] = 'Archive'; |
4 | 4 | if (is_day()) { |
5 | - $context['title'] = 'Archive: ' . get_the_date('D M Y'); |
|
5 | + $context['title'] = 'Archive: '.get_the_date('D M Y'); |
|
6 | 6 | } else if (is_month()) { |
7 | - $context['title'] = 'Archive: ' . get_the_date('M Y'); |
|
7 | + $context['title'] = 'Archive: '.get_the_date('M Y'); |
|
8 | 8 | } else if (is_year()) { |
9 | - $context['title'] = 'Archive: ' . get_the_date('Y'); |
|
9 | + $context['title'] = 'Archive: '.get_the_date('Y'); |
|
10 | 10 | } else if (is_tag()) { |
11 | 11 | $context['title'] = single_tag_title('', false); |
12 | 12 | } else if (is_category()) { |
13 | 13 | $context['title'] = single_cat_title('', false); |
14 | - array_unshift($templates, 'archive-' . get_query_var('cat') . '.twig'); |
|
14 | + array_unshift($templates, 'archive-'.get_query_var('cat').'.twig'); |
|
15 | 15 | } else if (is_post_type_archive()) { |
16 | 16 | $context['title'] = post_type_archive_title('', false); |
17 | - array_unshift($templates, 'archive-' . get_post_type() . '.twig'); |
|
17 | + array_unshift($templates, 'archive-'.get_post_type().'.twig'); |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | $context['posts'] = Timber::get_posts(); |
@@ -1,4 +1,4 @@ |
||
1 | 1 | <?php |
2 | 2 | use Undefined\Stash\Cache; |
3 | 3 | |
4 | -Timber::render(array('single-' . $context['post']->ID . '.twig', 'single-' . $context['post']->post_type . '.twig', 'single.twig'), $context, Cache::getTimerTime()); |
|
4 | +Timber::render(array('single-'.$context['post']->ID.'.twig', 'single-'.$context['post']->post_type.'.twig', 'single.twig'), $context, Cache::getTimerTime()); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$context['title'] = 'Category: ' . single_cat_title('', false); |
|
3 | +$context['title'] = 'Category: '.single_cat_title('', false); |
|
4 | 4 | |
5 | 5 | $context['posts'] = Timber::get_posts(); |
6 | 6 |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | /** |
40 | 40 | * Set all pages from within the functions.php->setControllers() |
41 | 41 | * |
42 | - * @param $pages |
|
42 | + * @param string[] $pages |
|
43 | 43 | */ |
44 | 44 | public function setPages($pages) |
45 | 45 | { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | /** |
50 | 50 | * Set all pages from within the functions.php->setControllers() |
51 | 51 | * |
52 | - * @param $pages |
|
52 | + * @param string[] $pages |
|
53 | 53 | */ |
54 | 54 | public function setParentPages($pages) |
55 | 55 | { |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | /** |
199 | 199 | * Return name of the body class |
200 | 200 | * |
201 | - * @return bool|string |
|
201 | + * @return string|false |
|
202 | 202 | */ |
203 | 203 | public function getClass() |
204 | 204 | { |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | $context = $this->context; |
88 | 88 | |
89 | - $file = get_template_directory() . '/controllers/single/' . strtolower($this->context['post']->post_type) . '.php'; |
|
89 | + $file = get_template_directory().'/controllers/single/'.strtolower($this->context['post']->post_type).'.php'; |
|
90 | 90 | |
91 | 91 | if (file_exists($file)) { |
92 | 92 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | include($file); |
96 | 96 | } else { |
97 | - Timber::render(array('single-' . $context['post']->ID . '.twig', 'single-' . $context['post']->post_type . '.twig', 'single.twig'), $context, Cache::getTimerTime()); |
|
97 | + Timber::render(array('single-'.$context['post']->ID.'.twig', 'single-'.$context['post']->post_type.'.twig', 'single.twig'), $context, Cache::getTimerTime()); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 | |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | |
110 | 110 | public function fourOFour() |
111 | 111 | { |
112 | - include(get_template_directory() . '/controllers/404.php'); |
|
112 | + include(get_template_directory().'/controllers/404.php'); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | public function archive() |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | $context = $this->context; |
120 | 120 | |
121 | 121 | if (is_category()) { |
122 | - $file = get_template_directory() . '/controllers/archive/category.php'; |
|
122 | + $file = get_template_directory().'/controllers/archive/category.php'; |
|
123 | 123 | } else if (is_tax()) { |
124 | - $file = get_template_directory() . '/controllers/archive/tax.php'; |
|
124 | + $file = get_template_directory().'/controllers/archive/tax.php'; |
|
125 | 125 | } else { |
126 | - $file = get_template_directory() . '/controllers/archive/' . strtolower($this->context['post']->title) . '.php'; |
|
126 | + $file = get_template_directory().'/controllers/archive/'.strtolower($this->context['post']->title).'.php'; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | if (file_exists($file)) { |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | include($file); |
134 | 134 | } else { |
135 | - Timber::render(array('single-' . $context['post']->ID . '.twig', 'single-' . $context['post']->post_type . '.twig', 'single.twig'), $context, Cache::getTimerTime()); |
|
135 | + Timber::render(array('single-'.$context['post']->ID.'.twig', 'single-'.$context['post']->post_type.'.twig', 'single.twig'), $context, Cache::getTimerTime()); |
|
136 | 136 | } |
137 | 137 | } |
138 | 138 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | /** |
150 | 150 | * See if controller excists else fall back to default |
151 | 151 | */ |
152 | - $file = get_template_directory() . '/controllers/pages/' . $page . '.php'; |
|
152 | + $file = get_template_directory().'/controllers/pages/'.$page.'.php'; |
|
153 | 153 | $this->found = $page; |
154 | 154 | } |
155 | 155 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * See if controller excists else fall back to default |
164 | 164 | */ |
165 | - $file = get_template_directory() . '/controllers/pages/' . $page . '.php'; |
|
165 | + $file = get_template_directory().'/controllers/pages/'.$page.'.php'; |
|
166 | 166 | $this->found = $page; |
167 | 167 | } |
168 | 168 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | { |
193 | 193 | $this->setContext(); |
194 | 194 | $context = $this->context; |
195 | - Timber::render(['page-' . strtolower($this->context['post']->post_name) . '.twig', 'page.twig'], $this->context, Cache::getTimerTime()); |
|
195 | + Timber::render(['page-'.strtolower($this->context['post']->post_name).'.twig', 'page.twig'], $this->context, Cache::getTimerTime()); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | public function getClass() |
204 | 204 | { |
205 | 205 | if ($this->found) { |
206 | - return 'page-' . $this->found; |
|
206 | + return 'page-'.$this->found; |
|
207 | 207 | } else { |
208 | 208 | return false; |
209 | 209 | } |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | */ |
8 | 8 | |
9 | 9 | if (!class_exists('Timber')) { |
10 | - add_action('admin_notices', function () { |
|
11 | - 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>'; |
|
10 | + add_action('admin_notices', function() { |
|
11 | + 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>'; |
|
12 | 12 | }); |
13 | 13 | |
14 | 14 | return; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $twig->addGlobal('image', new ImageHelper()); |
62 | 62 | |
63 | 63 | if (function_exists('pll_register_string')) { |
64 | - $filter = new Twig_SimpleFilter("translate", function ($string) { |
|
64 | + $filter = new Twig_SimpleFilter("translate", function($string) { |
|
65 | 65 | pll_register_string($string, $string, "stash"); |
66 | 66 | |
67 | 67 | return pll__($string); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | if (function_exists('wpautop')) { |
74 | - $filter = new Twig_SimpleFilter("p", function ($object) { |
|
74 | + $filter = new Twig_SimpleFilter("p", function($object) { |
|
75 | 75 | return wpautop($object); |
76 | 76 | }); |
77 | 77 |
@@ -23,11 +23,11 @@ |
||
23 | 23 | function display($name) |
24 | 24 | { |
25 | 25 | $stream_opts = [ |
26 | - "ssl" => [ |
|
27 | - "verify_peer" => false, |
|
28 | - "verify_peer_name" => false, |
|
29 | - ] |
|
30 | - ]; |
|
26 | + "ssl" => [ |
|
27 | + "verify_peer" => false, |
|
28 | + "verify_peer_name" => false, |
|
29 | + ] |
|
30 | + ]; |
|
31 | 31 | |
32 | 32 | $imageUrl = $this->get($name); |
33 | 33 |
@@ -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 | /** |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | if (strpos($imageUrl, '.svg') !== false) { |
36 | 36 | return file_get_contents($imageUrl, false, stream_context_create($stream_opts)); |
37 | 37 | } else { |
38 | - return "<img src='" . $this->get($name) . "' />"; |
|
38 | + return "<img src='".$this->get($name)."' />"; |
|
39 | 39 | } |
40 | 40 | } |
41 | 41 | } |