@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | { |
9 | 9 | public $postmeta; |
10 | 10 | |
11 | - public function __construct( PostMeta $postmeta ) |
|
11 | + public function __construct(PostMeta $postmeta) |
|
12 | 12 | { |
13 | 13 | $this->postmeta = $postmeta; |
14 | 14 | } |
@@ -18,9 +18,9 @@ discard block |
||
18 | 18 | * |
19 | 19 | * @return string |
20 | 20 | */ |
21 | - public function assetPath( $asset ) |
|
21 | + public function assetPath($asset) |
|
22 | 22 | { |
23 | - return $this->paths( 'dir.stylesheet' ) . 'assets/' . $asset; |
|
23 | + return $this->paths('dir.stylesheet') . 'assets/' . $asset; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return string |
30 | 30 | */ |
31 | - public function assetUri( $asset ) |
|
31 | + public function assetUri($asset) |
|
32 | 32 | { |
33 | - return $this->paths( 'uri.stylesheet' ) . 'assets/' . $asset; |
|
33 | + return $this->paths('uri.stylesheet') . 'assets/' . $asset; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -44,9 +44,9 @@ discard block |
||
44 | 44 | is_single(), |
45 | 45 | ]; |
46 | 46 | |
47 | - $display = in_array( true, $conditions ); |
|
47 | + $display = in_array(true, $conditions); |
|
48 | 48 | |
49 | - return apply_filters( 'castor/display/sidebar', $display ); |
|
49 | + return apply_filters('castor/display/sidebar', $display); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -54,9 +54,9 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return string |
56 | 56 | */ |
57 | - public function imagePath( $asset ) |
|
57 | + public function imagePath($asset) |
|
58 | 58 | { |
59 | - return $this->paths( 'dir.stylesheet' ) . 'assets/img/' . $asset; |
|
59 | + return $this->paths('dir.stylesheet') . 'assets/img/' . $asset; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | /** |
@@ -64,16 +64,16 @@ discard block |
||
64 | 64 | * |
65 | 65 | * @return string |
66 | 66 | */ |
67 | - public function imageUri( $asset ) |
|
67 | + public function imageUri($asset) |
|
68 | 68 | { |
69 | - return $this->paths( 'uri.stylesheet' ) . 'assets/img/' . $asset; |
|
69 | + return $this->paths('uri.stylesheet') . 'assets/img/' . $asset; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | public function pageTitle() |
73 | 73 | { |
74 | - foreach( ['is_404', 'is_archive', 'is_home', 'is_page', 'is_search'] as $bool ) { |
|
75 | - if( !$bool() )continue; |
|
76 | - $method = sprintf( 'get%sTitle', ucfirst( str_replace( 'is_', '', $bool ))); |
|
74 | + foreach (['is_404', 'is_archive', 'is_home', 'is_page', 'is_search'] as $bool) { |
|
75 | + if (!$bool())continue; |
|
76 | + $method = sprintf('get%sTitle', ucfirst(str_replace('is_', '', $bool))); |
|
77 | 77 | return $this->$method(); |
78 | 78 | } |
79 | 79 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * |
86 | 86 | * @return array|string |
87 | 87 | */ |
88 | - public function paths( $path = null ) |
|
88 | + public function paths($path = null) |
|
89 | 89 | { |
90 | 90 | $paths = [ |
91 | 91 | 'dir.stylesheet' => get_stylesheet_directory(), |
@@ -95,18 +95,18 @@ discard block |
||
95 | 95 | 'uri.template' => get_template_directory_uri(), |
96 | 96 | ]; |
97 | 97 | |
98 | - if( is_null( $path )) { |
|
98 | + if (is_null($path)) { |
|
99 | 99 | return $paths; |
100 | 100 | } |
101 | 101 | |
102 | - return array_key_exists( $path, $paths ) |
|
103 | - ? trailingslashit( $paths[$path] ) |
|
102 | + return array_key_exists($path, $paths) |
|
103 | + ? trailingslashit($paths[$path]) |
|
104 | 104 | : ''; |
105 | 105 | } |
106 | 106 | |
107 | 107 | protected function get404Title() |
108 | 108 | { |
109 | - return __( 'Not Found', 'castor' ); |
|
109 | + return __('Not Found', 'castor'); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | protected function getArchiveTitle() |
@@ -116,20 +116,20 @@ discard block |
||
116 | 116 | |
117 | 117 | protected function getHomeTitle() |
118 | 118 | { |
119 | - return ( $home = get_option( 'page_for_posts', true )) |
|
120 | - ? get_the_title( $home ) |
|
121 | - : __( 'Latest Posts', 'castor' ); |
|
119 | + return ($home = get_option('page_for_posts', true)) |
|
120 | + ? get_the_title($home) |
|
121 | + : __('Latest Posts', 'castor'); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | protected function getPageTitle() |
125 | 125 | { |
126 | - return ($title = $this->postmeta->get( 'title' )) |
|
126 | + return ($title = $this->postmeta->get('title')) |
|
127 | 127 | ? $title |
128 | 128 | : get_the_title(); |
129 | 129 | } |
130 | 130 | |
131 | 131 | protected function getSearchTitle() |
132 | 132 | { |
133 | - return sprintf( __( 'Search Results for %s', 'castor' ), get_search_query() ); |
|
133 | + return sprintf(__('Search Results for %s', 'castor'), get_search_query()); |
|
134 | 134 | } |
135 | 135 | } |