@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | */ |
| 27 | 27 | public function enqueueAssets() |
| 28 | 28 | { |
| 29 | - if( apply_filters( 'site-reviews/assets/css', true )) { |
|
| 29 | + if( apply_filters( 'site-reviews/assets/css', true ) ) { |
|
| 30 | 30 | wp_enqueue_style( |
| 31 | 31 | Application::ID, |
| 32 | 32 | $this->getStylesheet(), |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | glsr()->version |
| 35 | 35 | ); |
| 36 | 36 | } |
| 37 | - if( apply_filters( 'site-reviews/assets/js', true )) { |
|
| 37 | + if( apply_filters( 'site-reviews/assets/js', true ) ) { |
|
| 38 | 38 | $dependencies = apply_filters( 'site-reviews/assets/polyfill', true ) |
| 39 | 39 | ? [Application::ID.'/polyfill'] |
| 40 | 40 | : []; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function enqueuePolyfillService() |
| 56 | 56 | { |
| 57 | - if( !apply_filters( 'site-reviews/assets/polyfill', true ))return; |
|
| 57 | + if( !apply_filters( 'site-reviews/assets/polyfill', true ) )return; |
|
| 58 | 58 | wp_enqueue_script( |
| 59 | 59 | Application::ID.'/polyfill', |
| 60 | 60 | 'https://cdn.polyfill.io/v2/polyfill.js?features=Element.prototype.closest,Element.prototype.dataset,Event&flags=gated', |
@@ -70,12 +70,12 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | if( glsr( OptionManager::class )->get( 'settings.submissions.recaptcha.integration' ) != 'custom' )return; |
| 72 | 72 | $language = apply_filters( 'site-reviews/recaptcha/language', get_locale() ); |
| 73 | - wp_enqueue_script( Application::ID.'/google-recaptcha', add_query_arg([ |
|
| 73 | + wp_enqueue_script( Application::ID.'/google-recaptcha', add_query_arg( [ |
|
| 74 | 74 | 'hl' => $language, |
| 75 | 75 | 'onload' => 'glsr_render_recaptcha', |
| 76 | 76 | 'render' => 'explicit', |
| 77 | - ], 'https://www.google.com/recaptcha/api.js' )); |
|
| 78 | - $inlineScript = file_get_contents( glsr()->path( 'assets/scripts/recaptcha.js' )); |
|
| 77 | + ], 'https://www.google.com/recaptcha/api.js' ) ); |
|
| 78 | + $inlineScript = file_get_contents( glsr()->path( 'assets/scripts/recaptcha.js' ) ); |
|
| 79 | 79 | wp_add_inline_script( Application::ID.'/google-recaptcha', $inlineScript, 'before' ); |
| 80 | 80 | } |
| 81 | 81 | |
@@ -86,8 +86,8 @@ discard block |
||
| 86 | 86 | public function inlineStyles() |
| 87 | 87 | { |
| 88 | 88 | $inlineStylesheetPath = glsr()->path( 'assets/styles/inline-styles.css' ); |
| 89 | - if( !apply_filters( 'site-reviews/assets/css', true ))return; |
|
| 90 | - if( !file_exists( $inlineStylesheetPath )) { |
|
| 89 | + if( !apply_filters( 'site-reviews/assets/css', true ) )return; |
|
| 90 | + if( !file_exists( $inlineStylesheetPath ) ) { |
|
| 91 | 91 | glsr_log()->error( 'Inline stylesheet is missing: '.$inlineStylesheetPath ); |
| 92 | 92 | return; |
| 93 | 93 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | */ |
| 122 | 122 | protected function getFixedSelectorsForPagination() |
| 123 | 123 | { |
| 124 | - $selectors = ['#wpadminbar','.site-navigation-fixed']; |
|
| 124 | + $selectors = ['#wpadminbar', '.site-navigation-fixed']; |
|
| 125 | 125 | return apply_filters( 'site-reviews/localize/pagination/selectors', $selectors ); |
| 126 | 126 | } |
| 127 | 127 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | protected function getStylesheet() |
| 132 | 132 | { |
| 133 | 133 | $currentStyle = glsr( Style::class )->style; |
| 134 | - return file_exists( glsr()->path( 'assets/styles/custom/'.$currentStyle.'.css' )) |
|
| 134 | + return file_exists( glsr()->path( 'assets/styles/custom/'.$currentStyle.'.css' ) ) |
|
| 135 | 135 | ? glsr()->url( 'assets/styles/custom/'.$currentStyle.'.css' ) |
| 136 | 136 | : glsr()->url( 'assets/styles/'.Application::ID.'.css' ); |
| 137 | 137 | } |
@@ -54,7 +54,9 @@ discard block |
||
| 54 | 54 | */ |
| 55 | 55 | public function enqueuePolyfillService() |
| 56 | 56 | { |
| 57 | - if( !apply_filters( 'site-reviews/assets/polyfill', true ))return; |
|
| 57 | + if( !apply_filters( 'site-reviews/assets/polyfill', true )) { |
|
| 58 | + return; |
|
| 59 | + } |
|
| 58 | 60 | wp_enqueue_script( |
| 59 | 61 | Application::ID.'/polyfill', |
| 60 | 62 | 'https://cdn.polyfill.io/v2/polyfill.js?features=Element.prototype.closest,Element.prototype.dataset,Event&flags=gated', |
@@ -68,7 +70,9 @@ discard block |
||
| 68 | 70 | */ |
| 69 | 71 | public function enqueueRecaptchaScript() |
| 70 | 72 | { |
| 71 | - if( glsr( OptionManager::class )->get( 'settings.submissions.recaptcha.integration' ) != 'custom' )return; |
|
| 73 | + if( glsr( OptionManager::class )->get( 'settings.submissions.recaptcha.integration' ) != 'custom' ) { |
|
| 74 | + return; |
|
| 75 | + } |
|
| 72 | 76 | $language = apply_filters( 'site-reviews/recaptcha/language', get_locale() ); |
| 73 | 77 | wp_enqueue_script( Application::ID.'/google-recaptcha', add_query_arg([ |
| 74 | 78 | 'hl' => $language, |
@@ -86,7 +90,9 @@ discard block |
||
| 86 | 90 | public function inlineStyles() |
| 87 | 91 | { |
| 88 | 92 | $inlineStylesheetPath = glsr()->path( 'assets/styles/inline-styles.css' ); |
| 89 | - if( !apply_filters( 'site-reviews/assets/css', true ))return; |
|
| 93 | + if( !apply_filters( 'site-reviews/assets/css', true )) { |
|
| 94 | + return; |
|
| 95 | + } |
|
| 90 | 96 | if( !file_exists( $inlineStylesheetPath )) { |
| 91 | 97 | glsr_log()->error( 'Inline stylesheet is missing: '.$inlineStylesheetPath ); |
| 92 | 98 | return; |