@@ -28,19 +28,19 @@ discard block |
||
28 | 28 | const UNKNOWN_CODE = 0; |
29 | 29 | const FORM_URLENCODED = 'application/x-www-form-urlencoded'; |
30 | 30 | private static $CONNECTION_ESTABLISHED_HEADERS = array( |
31 | - "HTTP/1.0 200 Connection established\r\n\r\n", |
|
32 | - "HTTP/1.1 200 Connection established\r\n\r\n", |
|
31 | + "HTTP/1.0 200 Connection established\r\n\r\n", |
|
32 | + "HTTP/1.1 200 Connection established\r\n\r\n", |
|
33 | 33 | ); |
34 | 34 | private static $ENTITY_HTTP_METHODS = array("POST" => null, "PUT" => null); |
35 | 35 | private static $HOP_BY_HOP = array( |
36 | - 'connection' => true, |
|
37 | - 'keep-alive' => true, |
|
38 | - 'proxy-authenticate' => true, |
|
39 | - 'proxy-authorization' => true, |
|
40 | - 'te' => true, |
|
41 | - 'trailers' => true, |
|
42 | - 'transfer-encoding' => true, |
|
43 | - 'upgrade' => true |
|
36 | + 'connection' => true, |
|
37 | + 'keep-alive' => true, |
|
38 | + 'proxy-authenticate' => true, |
|
39 | + 'proxy-authorization' => true, |
|
40 | + 'te' => true, |
|
41 | + 'trailers' => true, |
|
42 | + 'transfer-encoding' => true, |
|
43 | + 'upgrade' => true |
|
44 | 44 | ); |
45 | 45 | |
46 | 46 | |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | |
50 | 50 | public function __construct(Google_Client $client) |
51 | 51 | { |
52 | - $this->client = $client; |
|
53 | - $timeout = $client->getClassConfig('Google_IO_Abstract', 'request_timeout_seconds'); |
|
54 | - if ($timeout > 0) { |
|
55 | - $this->setTimeout($timeout); |
|
56 | - } |
|
52 | + $this->client = $client; |
|
53 | + $timeout = $client->getClassConfig('Google_IO_Abstract', 'request_timeout_seconds'); |
|
54 | + if ($timeout > 0) { |
|
55 | + $this->setTimeout($timeout); |
|
56 | + } |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -102,13 +102,13 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function setCachedRequest(Google_Http_Request $request) |
104 | 104 | { |
105 | - // Determine if the request is cacheable. |
|
106 | - if (Google_Http_CacheParser::isResponseCacheable($request)) { |
|
107 | - $this->client->getCache()->set($request->getCacheKey(), $request); |
|
108 | - return true; |
|
109 | - } |
|
105 | + // Determine if the request is cacheable. |
|
106 | + if (Google_Http_CacheParser::isResponseCacheable($request)) { |
|
107 | + $this->client->getCache()->set($request->getCacheKey(), $request); |
|
108 | + return true; |
|
109 | + } |
|
110 | 110 | |
111 | - return false; |
|
111 | + return false; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -121,37 +121,37 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function makeRequest(Google_Http_Request $request) |
123 | 123 | { |
124 | - // First, check to see if we have a valid cached version. |
|
125 | - $cached = $this->getCachedRequest($request); |
|
126 | - if ($cached !== false && $cached instanceof Google_Http_Request) { |
|
127 | - if (!$this->checkMustRevalidateCachedRequest($cached, $request)) { |
|
128 | - return $cached; |
|
129 | - } |
|
130 | - } |
|
131 | - |
|
132 | - if (array_key_exists($request->getRequestMethod(), self::$ENTITY_HTTP_METHODS)) { |
|
133 | - $request = $this->processEntityRequest($request); |
|
134 | - } |
|
135 | - |
|
136 | - list($responseData, $responseHeaders, $respHttpCode) = $this->executeRequest($request); |
|
137 | - |
|
138 | - if ($respHttpCode == 304 && $cached) { |
|
139 | - // If the server responded NOT_MODIFIED, return the cached request. |
|
140 | - $this->updateCachedRequest($cached, $responseHeaders); |
|
141 | - return $cached; |
|
142 | - } |
|
143 | - |
|
144 | - if (!isset($responseHeaders['Date']) && !isset($responseHeaders['date'])) { |
|
145 | - $responseHeaders['date'] = date("r"); |
|
146 | - } |
|
147 | - |
|
148 | - $request->setResponseHttpCode($respHttpCode); |
|
149 | - $request->setResponseHeaders($responseHeaders); |
|
150 | - $request->setResponseBody($responseData); |
|
151 | - // Store the request in cache (the function checks to see if the request |
|
152 | - // can actually be cached) |
|
153 | - $this->setCachedRequest($request); |
|
154 | - return $request; |
|
124 | + // First, check to see if we have a valid cached version. |
|
125 | + $cached = $this->getCachedRequest($request); |
|
126 | + if ($cached !== false && $cached instanceof Google_Http_Request) { |
|
127 | + if (!$this->checkMustRevalidateCachedRequest($cached, $request)) { |
|
128 | + return $cached; |
|
129 | + } |
|
130 | + } |
|
131 | + |
|
132 | + if (array_key_exists($request->getRequestMethod(), self::$ENTITY_HTTP_METHODS)) { |
|
133 | + $request = $this->processEntityRequest($request); |
|
134 | + } |
|
135 | + |
|
136 | + list($responseData, $responseHeaders, $respHttpCode) = $this->executeRequest($request); |
|
137 | + |
|
138 | + if ($respHttpCode == 304 && $cached) { |
|
139 | + // If the server responded NOT_MODIFIED, return the cached request. |
|
140 | + $this->updateCachedRequest($cached, $responseHeaders); |
|
141 | + return $cached; |
|
142 | + } |
|
143 | + |
|
144 | + if (!isset($responseHeaders['Date']) && !isset($responseHeaders['date'])) { |
|
145 | + $responseHeaders['date'] = date("r"); |
|
146 | + } |
|
147 | + |
|
148 | + $request->setResponseHttpCode($respHttpCode); |
|
149 | + $request->setResponseHeaders($responseHeaders); |
|
150 | + $request->setResponseBody($responseData); |
|
151 | + // Store the request in cache (the function checks to see if the request |
|
152 | + // can actually be cached) |
|
153 | + $this->setCachedRequest($request); |
|
154 | + return $request; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -162,11 +162,11 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function getCachedRequest(Google_Http_Request $request) |
164 | 164 | { |
165 | - if (false === Google_Http_CacheParser::isRequestCacheable($request)) { |
|
166 | - return false; |
|
167 | - } |
|
165 | + if (false === Google_Http_CacheParser::isRequestCacheable($request)) { |
|
166 | + return false; |
|
167 | + } |
|
168 | 168 | |
169 | - return $this->client->getCache()->get($request->getCacheKey()); |
|
169 | + return $this->client->getCache()->get($request->getCacheKey()); |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | /** |
@@ -177,28 +177,28 @@ discard block |
||
177 | 177 | */ |
178 | 178 | public function processEntityRequest(Google_Http_Request $request) |
179 | 179 | { |
180 | - $postBody = $request->getPostBody(); |
|
181 | - $contentType = $request->getRequestHeader("content-type"); |
|
182 | - |
|
183 | - // Set the default content-type as application/x-www-form-urlencoded. |
|
184 | - if (false == $contentType) { |
|
185 | - $contentType = self::FORM_URLENCODED; |
|
186 | - $request->setRequestHeaders(array('content-type' => $contentType)); |
|
187 | - } |
|
188 | - |
|
189 | - // Force the payload to match the content-type asserted in the header. |
|
190 | - if ($contentType == self::FORM_URLENCODED && is_array($postBody)) { |
|
191 | - $postBody = http_build_query($postBody, '', '&'); |
|
192 | - $request->setPostBody($postBody); |
|
193 | - } |
|
194 | - |
|
195 | - // Make sure the content-length header is set. |
|
196 | - if (!$postBody || is_string($postBody)) { |
|
197 | - $postsLength = strlen($postBody); |
|
198 | - $request->setRequestHeaders(array('content-length' => $postsLength)); |
|
199 | - } |
|
200 | - |
|
201 | - return $request; |
|
180 | + $postBody = $request->getPostBody(); |
|
181 | + $contentType = $request->getRequestHeader("content-type"); |
|
182 | + |
|
183 | + // Set the default content-type as application/x-www-form-urlencoded. |
|
184 | + if (false == $contentType) { |
|
185 | + $contentType = self::FORM_URLENCODED; |
|
186 | + $request->setRequestHeaders(array('content-type' => $contentType)); |
|
187 | + } |
|
188 | + |
|
189 | + // Force the payload to match the content-type asserted in the header. |
|
190 | + if ($contentType == self::FORM_URLENCODED && is_array($postBody)) { |
|
191 | + $postBody = http_build_query($postBody, '', '&'); |
|
192 | + $request->setPostBody($postBody); |
|
193 | + } |
|
194 | + |
|
195 | + // Make sure the content-length header is set. |
|
196 | + if (!$postBody || is_string($postBody)) { |
|
197 | + $postsLength = strlen($postBody); |
|
198 | + $request->setRequestHeaders(array('content-length' => $postsLength)); |
|
199 | + } |
|
200 | + |
|
201 | + return $request; |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
@@ -211,21 +211,21 @@ discard block |
||
211 | 211 | */ |
212 | 212 | protected function checkMustRevalidateCachedRequest($cached, $request) |
213 | 213 | { |
214 | - if (Google_Http_CacheParser::mustRevalidate($cached)) { |
|
215 | - $addHeaders = array(); |
|
216 | - if ($cached->getResponseHeader('etag')) { |
|
217 | - // [13.3.4] If an entity tag has been provided by the origin server, |
|
218 | - // we must use that entity tag in any cache-conditional request. |
|
219 | - $addHeaders['If-None-Match'] = $cached->getResponseHeader('etag'); |
|
220 | - } elseif ($cached->getResponseHeader('date')) { |
|
221 | - $addHeaders['If-Modified-Since'] = $cached->getResponseHeader('date'); |
|
222 | - } |
|
223 | - |
|
224 | - $request->setRequestHeaders($addHeaders); |
|
225 | - return true; |
|
226 | - } else { |
|
227 | - return false; |
|
228 | - } |
|
214 | + if (Google_Http_CacheParser::mustRevalidate($cached)) { |
|
215 | + $addHeaders = array(); |
|
216 | + if ($cached->getResponseHeader('etag')) { |
|
217 | + // [13.3.4] If an entity tag has been provided by the origin server, |
|
218 | + // we must use that entity tag in any cache-conditional request. |
|
219 | + $addHeaders['If-None-Match'] = $cached->getResponseHeader('etag'); |
|
220 | + } elseif ($cached->getResponseHeader('date')) { |
|
221 | + $addHeaders['If-Modified-Since'] = $cached->getResponseHeader('date'); |
|
222 | + } |
|
223 | + |
|
224 | + $request->setRequestHeaders($addHeaders); |
|
225 | + return true; |
|
226 | + } else { |
|
227 | + return false; |
|
228 | + } |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
@@ -235,19 +235,19 @@ discard block |
||
235 | 235 | */ |
236 | 236 | protected function updateCachedRequest($cached, $responseHeaders) |
237 | 237 | { |
238 | - $hopByHop = self::$HOP_BY_HOP; |
|
239 | - if (!empty($responseHeaders['connection'])) { |
|
240 | - $connectionHeaders = array_map( |
|
241 | - 'strtolower', |
|
242 | - array_filter( |
|
243 | - array_map('trim', explode(',', $responseHeaders['connection'])) |
|
244 | - ) |
|
245 | - ); |
|
246 | - $hopByHop += array_fill_keys($connectionHeaders, true); |
|
247 | - } |
|
248 | - |
|
249 | - $endToEnd = array_diff_key($responseHeaders, $hopByHop); |
|
250 | - $cached->setResponseHeaders($endToEnd); |
|
238 | + $hopByHop = self::$HOP_BY_HOP; |
|
239 | + if (!empty($responseHeaders['connection'])) { |
|
240 | + $connectionHeaders = array_map( |
|
241 | + 'strtolower', |
|
242 | + array_filter( |
|
243 | + array_map('trim', explode(',', $responseHeaders['connection'])) |
|
244 | + ) |
|
245 | + ); |
|
246 | + $hopByHop += array_fill_keys($connectionHeaders, true); |
|
247 | + } |
|
248 | + |
|
249 | + $endToEnd = array_diff_key($responseHeaders, $hopByHop); |
|
250 | + $cached->setResponseHeaders($endToEnd); |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | /** |
@@ -259,33 +259,33 @@ discard block |
||
259 | 259 | */ |
260 | 260 | public function parseHttpResponse($respData, $headerSize) |
261 | 261 | { |
262 | - // check proxy header |
|
263 | - foreach (self::$CONNECTION_ESTABLISHED_HEADERS as $established_header) { |
|
264 | - if (stripos($respData, $established_header) !== false) { |
|
265 | - // existed, remove it |
|
266 | - $respData = str_ireplace($established_header, '', $respData); |
|
267 | - // Subtract the proxy header size unless the cURL bug prior to 7.30.0 |
|
268 | - // is present which prevented the proxy header size from being taken into |
|
269 | - // account. |
|
270 | - if (!$this->needsQuirk()) { |
|
271 | - $headerSize -= strlen($established_header); |
|
272 | - } |
|
273 | - break; |
|
274 | - } |
|
275 | - } |
|
276 | - |
|
277 | - if ($headerSize) { |
|
278 | - $responseBody = substr($respData, $headerSize); |
|
279 | - $responseHeaders = substr($respData, 0, $headerSize); |
|
280 | - } else { |
|
281 | - $responseSegments = explode("\r\n\r\n", $respData, 2); |
|
282 | - $responseHeaders = $responseSegments[0]; |
|
283 | - $responseBody = isset($responseSegments[1]) ? $responseSegments[1] : |
|
284 | - null; |
|
285 | - } |
|
286 | - |
|
287 | - $responseHeaders = $this->getHttpResponseHeaders($responseHeaders); |
|
288 | - return array($responseHeaders, $responseBody); |
|
262 | + // check proxy header |
|
263 | + foreach (self::$CONNECTION_ESTABLISHED_HEADERS as $established_header) { |
|
264 | + if (stripos($respData, $established_header) !== false) { |
|
265 | + // existed, remove it |
|
266 | + $respData = str_ireplace($established_header, '', $respData); |
|
267 | + // Subtract the proxy header size unless the cURL bug prior to 7.30.0 |
|
268 | + // is present which prevented the proxy header size from being taken into |
|
269 | + // account. |
|
270 | + if (!$this->needsQuirk()) { |
|
271 | + $headerSize -= strlen($established_header); |
|
272 | + } |
|
273 | + break; |
|
274 | + } |
|
275 | + } |
|
276 | + |
|
277 | + if ($headerSize) { |
|
278 | + $responseBody = substr($respData, $headerSize); |
|
279 | + $responseHeaders = substr($respData, 0, $headerSize); |
|
280 | + } else { |
|
281 | + $responseSegments = explode("\r\n\r\n", $respData, 2); |
|
282 | + $responseHeaders = $responseSegments[0]; |
|
283 | + $responseBody = isset($responseSegments[1]) ? $responseSegments[1] : |
|
284 | + null; |
|
285 | + } |
|
286 | + |
|
287 | + $responseHeaders = $this->getHttpResponseHeaders($responseHeaders); |
|
288 | + return array($responseHeaders, $responseBody); |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
@@ -295,45 +295,45 @@ discard block |
||
295 | 295 | */ |
296 | 296 | public function getHttpResponseHeaders($rawHeaders) |
297 | 297 | { |
298 | - if (is_array($rawHeaders)) { |
|
299 | - return $this->parseArrayHeaders($rawHeaders); |
|
300 | - } else { |
|
301 | - return $this->parseStringHeaders($rawHeaders); |
|
302 | - } |
|
298 | + if (is_array($rawHeaders)) { |
|
299 | + return $this->parseArrayHeaders($rawHeaders); |
|
300 | + } else { |
|
301 | + return $this->parseStringHeaders($rawHeaders); |
|
302 | + } |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | private function parseStringHeaders($rawHeaders) |
306 | 306 | { |
307 | - $headers = array(); |
|
308 | - $responseHeaderLines = explode("\r\n", $rawHeaders); |
|
309 | - foreach ($responseHeaderLines as $headerLine) { |
|
310 | - if ($headerLine && strpos($headerLine, ':') !== false) { |
|
311 | - list($header, $value) = explode(': ', $headerLine, 2); |
|
312 | - $header = strtolower($header); |
|
313 | - if (isset($headers[$header])) { |
|
314 | - $headers[$header] .= "\n" . $value; |
|
315 | - } else { |
|
316 | - $headers[$header] = $value; |
|
317 | - } |
|
318 | - } |
|
319 | - } |
|
320 | - return $headers; |
|
307 | + $headers = array(); |
|
308 | + $responseHeaderLines = explode("\r\n", $rawHeaders); |
|
309 | + foreach ($responseHeaderLines as $headerLine) { |
|
310 | + if ($headerLine && strpos($headerLine, ':') !== false) { |
|
311 | + list($header, $value) = explode(': ', $headerLine, 2); |
|
312 | + $header = strtolower($header); |
|
313 | + if (isset($headers[$header])) { |
|
314 | + $headers[$header] .= "\n" . $value; |
|
315 | + } else { |
|
316 | + $headers[$header] = $value; |
|
317 | + } |
|
318 | + } |
|
319 | + } |
|
320 | + return $headers; |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | private function parseArrayHeaders($rawHeaders) |
324 | 324 | { |
325 | - $header_count = count($rawHeaders); |
|
326 | - $headers = array(); |
|
327 | - |
|
328 | - for ($i = 0; $i < $header_count; $i++) { |
|
329 | - $header = $rawHeaders[$i]; |
|
330 | - // Times will have colons in - so we just want the first match. |
|
331 | - $header_parts = explode(': ', $header, 2); |
|
332 | - if (count($header_parts) == 2) { |
|
333 | - $headers[strtolower($header_parts[0])] = $header_parts[1]; |
|
334 | - } |
|
335 | - } |
|
336 | - |
|
337 | - return $headers; |
|
325 | + $header_count = count($rawHeaders); |
|
326 | + $headers = array(); |
|
327 | + |
|
328 | + for ($i = 0; $i < $header_count; $i++) { |
|
329 | + $header = $rawHeaders[$i]; |
|
330 | + // Times will have colons in - so we just want the first match. |
|
331 | + $header_parts = explode(': ', $header, 2); |
|
332 | + if (count($header_parts) == 2) { |
|
333 | + $headers[strtolower($header_parts[0])] = $header_parts[1]; |
|
334 | + } |
|
335 | + } |
|
336 | + |
|
337 | + return $headers; |
|
338 | 338 | } |
339 | 339 | } |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | |
22 | 22 | if (!class_exists('Google_Client')) { |
23 | - require_once dirname(__FILE__) . '/../autoload.php'; |
|
23 | + require_once dirname(__FILE__).'/../autoload.php'; |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | abstract class Google_IO_Abstract |
@@ -280,8 +280,7 @@ discard block |
||
280 | 280 | } else { |
281 | 281 | $responseSegments = explode("\r\n\r\n", $respData, 2); |
282 | 282 | $responseHeaders = $responseSegments[0]; |
283 | - $responseBody = isset($responseSegments[1]) ? $responseSegments[1] : |
|
284 | - null; |
|
283 | + $responseBody = isset($responseSegments[1]) ? $responseSegments[1] : null; |
|
285 | 284 | } |
286 | 285 | |
287 | 286 | $responseHeaders = $this->getHttpResponseHeaders($responseHeaders); |
@@ -311,7 +310,7 @@ discard block |
||
311 | 310 | list($header, $value) = explode(': ', $headerLine, 2); |
312 | 311 | $header = strtolower($header); |
313 | 312 | if (isset($headers[$header])) { |
314 | - $headers[$header] .= "\n" . $value; |
|
313 | + $headers[$header] .= "\n".$value; |
|
315 | 314 | } else { |
316 | 315 | $headers[$header] = $value; |
317 | 316 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | if (!class_exists('Google_Client')) { |
19 | - require_once dirname(__FILE__) . '/../autoload.php'; |
|
19 | + require_once dirname(__FILE__).'/../autoload.php'; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | class Google_IO_Exception extends Google_Exception implements Google_Task_Retryable |
@@ -16,7 +16,7 @@ |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | if (!class_exists('Google_Client')) { |
19 | - require_once dirname(__FILE__) . '/../autoload.php'; |
|
19 | + require_once dirname(__FILE__).'/../autoload.php'; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | class Google_IO_Exception extends Google_Exception implements Google_Task_Retryable |
@@ -16,7 +16,7 @@ |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | if (!class_exists('Google_Client')) { |
19 | - require_once dirname(__FILE__) . '/../autoload.php'; |
|
19 | + require_once dirname(__FILE__).'/../autoload.php'; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | class Google_IO_Exception extends Google_Exception implements Google_Task_Retryable |
@@ -16,7 +16,7 @@ |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | if (!class_exists('Google_Client')) { |
19 | - require_once dirname(__FILE__) . '/../autoload.php'; |
|
19 | + require_once dirname(__FILE__).'/../autoload.php'; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | class Google_IO_Exception extends Google_Exception implements Google_Task_Retryable |
@@ -16,7 +16,7 @@ |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | if (!class_exists('Google_Client')) { |
19 | - require_once dirname(__FILE__) . '/../autoload.php'; |
|
19 | + require_once dirname(__FILE__).'/../autoload.php'; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | class Google_IO_Exception extends Google_Exception implements Google_Task_Retryable |
@@ -16,7 +16,7 @@ |
||
16 | 16 | */ |
17 | 17 | |
18 | 18 | if (!class_exists('Google_Client')) { |
19 | - require_once dirname(__FILE__) . '/../autoload.php'; |
|
19 | + require_once dirname(__FILE__).'/../autoload.php'; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | class Google_IO_Exception extends Google_Exception implements Google_Task_Retryable |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -add_filter('post_thumbnail_html','geodir_2017_remove_header',10,5); |
|
5 | -function geodir_2017_remove_header($html, $post_ID, $post_thumbnail_id, $size, $attr){ |
|
6 | - if($size=='twentyseventeen-featured-image'){ |
|
4 | +add_filter('post_thumbnail_html', 'geodir_2017_remove_header', 10, 5); |
|
5 | +function geodir_2017_remove_header($html, $post_ID, $post_thumbnail_id, $size, $attr) { |
|
6 | + if ($size == 'twentyseventeen-featured-image') { |
|
7 | 7 | |
8 | - if(geodir_is_page('detail') || geodir_is_page('add-listing')){ |
|
9 | - $html = '';// nothing up top |
|
8 | + if (geodir_is_page('detail') || geodir_is_page('add-listing')) { |
|
9 | + $html = ''; // nothing up top |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | } |
@@ -63,19 +63,19 @@ discard block |
||
63 | 63 | |
64 | 64 | } |
65 | 65 | |
66 | -function geodir_twentyseventeen_body_classes($classes){ |
|
66 | +function geodir_twentyseventeen_body_classes($classes) { |
|
67 | 67 | |
68 | - if(geodir_is_page('add-listing') |
|
68 | + if (geodir_is_page('add-listing') |
|
69 | 69 | || geodir_is_page('preview') |
70 | 70 | || geodir_is_page('home') |
71 | 71 | || geodir_is_page('location') |
72 | 72 | || geodir_is_page('listing') |
73 | 73 | || geodir_is_page('search') |
74 | 74 | || geodir_is_page('author') |
75 | - ){ |
|
75 | + ) { |
|
76 | 76 | $classes[] = 'has-sidebar'; |
77 | 77 | } |
78 | 78 | return $classes; |
79 | 79 | } |
80 | -add_filter( 'body_class', 'geodir_twentyseventeen_body_classes' ); |
|
80 | +add_filter('body_class', 'geodir_twentyseventeen_body_classes'); |
|
81 | 81 |
@@ -46,17 +46,13 @@ |
||
46 | 46 | |
47 | 47 | if (is_page_geodir_home() || geodir_is_page('location')) { |
48 | 48 | add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_home_top', 8); |
49 | - } |
|
50 | - elseif (geodir_is_page('listing')) { |
|
49 | + } elseif (geodir_is_page('listing')) { |
|
51 | 50 | add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_listings_top', 8); |
52 | - } |
|
53 | - elseif (geodir_is_page('detail')) { |
|
51 | + } elseif (geodir_is_page('detail')) { |
|
54 | 52 | add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_detail_top', 8); |
55 | - } |
|
56 | - elseif (geodir_is_page('search')) { |
|
53 | + } elseif (geodir_is_page('search')) { |
|
57 | 54 | add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_search_top', 8); |
58 | - } |
|
59 | - elseif (geodir_is_page('author')) { |
|
55 | + } elseif (geodir_is_page('author')) { |
|
60 | 56 | add_action('geodir_wrapper_open', 'geodir_action_geodir_sidebar_author_top', 8); |
61 | 57 | } |
62 | 58 |