@@ -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 | } |