@@ -1,4 +1,4 @@ |
||
| 1 | -<?php defined('WPINC') || die; ?> |
|
| 1 | +<?php defined( 'WPINC' ) || die; ?> |
|
| 2 | 2 | |
| 3 | 3 | <button type="submit" class="glsr-button button btn"> |
| 4 | 4 | <span class="glsr-button-loading"></span> |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php defined('WPINC') || die; ?> |
|
| 1 | +<?php defined( 'WPINC' ) || die; ?> |
|
| 2 | 2 | |
| 3 | 3 | <span class="glsr-field-error"> |
| 4 | 4 | {{ errors }} |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php defined('WPINC') || die; ?> |
|
| 1 | +<?php defined( 'WPINC' ) || die; ?> |
|
| 2 | 2 | |
| 3 | 3 | <div class="glsr-field {{ class }}"> |
| 4 | 4 | <div class="glsr-field-choice"> |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php defined('WPINC') || die; ?> |
|
| 1 | +<?php defined( 'WPINC' ) || die; ?> |
|
| 2 | 2 | |
| 3 | 3 | <div class="glsr-field {{ class }}"> |
| 4 | 4 | {{ label }} |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php defined('WPINC') || die; ?> |
|
| 1 | +<?php defined( 'WPINC' ) || die; ?> |
|
| 2 | 2 | |
| 3 | 3 | <div class="pagination"> |
| 4 | 4 | <nav class="navigation" role="navigation"> |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php defined('WPINC') || die; ?> |
|
| 1 | +<?php defined( 'WPINC' ) || die; ?> |
|
| 2 | 2 | |
| 3 | 3 | <strong>A new {review_rating}-star review has been submitted:</strong> |
| 4 | 4 | |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php defined('WPINC') || die; ?> |
|
| 1 | +<?php defined( 'WPINC' ) || die; ?> |
|
| 2 | 2 | |
| 3 | 3 | <div class="glsr-login-register"> |
| 4 | 4 | <p>{{ text }}</p> |
@@ -1,4 +1,4 @@ |
||
| 1 | -<?php defined('WPINC') || die; ?> |
|
| 1 | +<?php defined( 'WPINC' ) || die; ?> |
|
| 2 | 2 | |
| 3 | 3 | <div class="glsr-reviews-wrap"> |
| 4 | 4 | <div class="{{ class }}" id="{{ id }}"> |
@@ -10,37 +10,37 @@ discard block |
||
| 10 | 10 | * @param int|string $postId |
| 11 | 11 | * @return \WP_Post|void|null |
| 12 | 12 | */ |
| 13 | - public function getPost($postId) |
|
| 13 | + public function getPost( $postId ) |
|
| 14 | 14 | { |
| 15 | - $postId = trim($postId); |
|
| 16 | - if (empty($postId) || !is_numeric($postId)) { |
|
| 15 | + $postId = trim( $postId ); |
|
| 16 | + if( empty($postId) || !is_numeric( $postId ) ) { |
|
| 17 | 17 | return; |
| 18 | 18 | } |
| 19 | - if ($this->isEnabled()) { |
|
| 20 | - $polylangPostId = pll_get_post($postId, pll_get_post_language(get_the_ID())); |
|
| 19 | + if( $this->isEnabled() ) { |
|
| 20 | + $polylangPostId = pll_get_post( $postId, pll_get_post_language( get_the_ID() ) ); |
|
| 21 | 21 | } |
| 22 | - if (!empty($polylangPostId)) { |
|
| 22 | + if( !empty($polylangPostId) ) { |
|
| 23 | 23 | $postId = $polylangPostId; |
| 24 | 24 | } |
| 25 | - return get_post(intval($postId)); |
|
| 25 | + return get_post( intval( $postId ) ); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * @return array |
| 30 | 30 | */ |
| 31 | - public function getPostIds(array $postIds) |
|
| 31 | + public function getPostIds( array $postIds ) |
|
| 32 | 32 | { |
| 33 | - if (!$this->isEnabled()) { |
|
| 33 | + if( !$this->isEnabled() ) { |
|
| 34 | 34 | return $postIds; |
| 35 | 35 | } |
| 36 | 36 | $newPostIds = []; |
| 37 | - foreach ($this->cleanIds($postIds) as $postId) { |
|
| 37 | + foreach( $this->cleanIds( $postIds ) as $postId ) { |
|
| 38 | 38 | $newPostIds = array_merge( |
| 39 | 39 | $newPostIds, |
| 40 | - array_values(pll_get_post_translations($postId)) |
|
| 40 | + array_values( pll_get_post_translations( $postId ) ) |
|
| 41 | 41 | ); |
| 42 | 42 | } |
| 43 | - return $this->cleanIds($newPostIds); |
|
| 43 | + return $this->cleanIds( $newPostIds ); |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | /** |
@@ -48,10 +48,10 @@ discard block |
||
| 48 | 48 | */ |
| 49 | 49 | public function isActive() |
| 50 | 50 | { |
| 51 | - return function_exists('PLL') |
|
| 52 | - && function_exists('pll_get_post') |
|
| 53 | - && function_exists('pll_get_post_language') |
|
| 54 | - && function_exists('pll_get_post_translations'); |
|
| 51 | + return function_exists( 'PLL' ) |
|
| 52 | + && function_exists( 'pll_get_post' ) |
|
| 53 | + && function_exists( 'pll_get_post_language' ) |
|
| 54 | + && function_exists( 'pll_get_post_translations' ); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /** |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | public function isEnabled() |
| 61 | 61 | { |
| 62 | 62 | return $this->isActive() |
| 63 | - && glsr(OptionManager::class)->getBool('settings.general.support.polylang'); |
|
| 63 | + && glsr( OptionManager::class )->getBool( 'settings.general.support.polylang' ); |
|
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | /** |
@@ -68,15 +68,15 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function isSupported() |
| 70 | 70 | { |
| 71 | - return defined('POLYLANG_VERSION') |
|
| 72 | - && version_compare(POLYLANG_VERSION, '2.3', '>='); |
|
| 71 | + return defined( 'POLYLANG_VERSION' ) |
|
| 72 | + && version_compare( POLYLANG_VERSION, '2.3', '>=' ); |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | /** |
| 76 | 76 | * @return array |
| 77 | 77 | */ |
| 78 | - protected function cleanIds(array $postIds) |
|
| 78 | + protected function cleanIds( array $postIds ) |
|
| 79 | 79 | { |
| 80 | - return array_filter(array_unique($postIds)); |
|
| 80 | + return array_filter( array_unique( $postIds ) ); |
|
| 81 | 81 | } |
| 82 | 82 | } |