Conditions | 4 |
Paths | 6 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
7 | function getTimberDefaultContext($singlePost = false) |
||
8 | { |
||
9 | $context = Timber::get_context(); |
||
10 | if ($singlePost) { |
||
11 | if (is_numeric($singlePost)) { |
||
12 | $context['post'] = new Post($singlePost); |
||
13 | } else { |
||
14 | $context['post'] = new Post(); |
||
15 | } |
||
16 | } else { |
||
17 | $context['posts'] = new PostQuery(); |
||
18 | } |
||
19 | $context['feedTitle'] = $context['site']->name . ' ' . __('Feed', 'flynt-starter-theme'); |
||
20 | $context['dir'] = is_rtl() ? 'rtl' : 'ltr'; |
||
21 | |||
22 | return $context; |
||
23 | } |
||
24 |