@@ -43,7 +43,9 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function send( Review $review ) |
45 | 45 | { |
46 | - if( empty( $this->types ))return; |
|
46 | + if( empty( $this->types )) { |
|
47 | + return; |
|
48 | + } |
|
47 | 49 | $this->review = $review; |
48 | 50 | $args = [ |
49 | 51 | 'link' => $this->getLink(), |
@@ -146,7 +148,9 @@ discard block |
||
146 | 148 | protected function sendToEmail( array $args ) |
147 | 149 | { |
148 | 150 | $email = $this->buildEmail( $args ); |
149 | - if( !$this->email )return; |
|
151 | + if( !$this->email ) { |
|
152 | + return; |
|
153 | + } |
|
150 | 154 | if( empty( $email->to )) { |
151 | 155 | glsr_log()->error( 'Email notification was not sent (missing email address)' ); |
152 | 156 | return; |
@@ -161,7 +165,9 @@ discard block |
||
161 | 165 | */ |
162 | 166 | protected function sendToSlack( array $args ) |
163 | 167 | { |
164 | - if( !$this->slack )return; |
|
168 | + if( !$this->slack ) { |
|
169 | + return; |
|
170 | + } |
|
165 | 171 | $notification = $this->buildSlackNotification( $args ); |
166 | 172 | $result = $notification->send(); |
167 | 173 | if( is_wp_error( $result )) { |
@@ -175,8 +175,12 @@ discard block |
||
175 | 175 | */ |
176 | 176 | protected function validateAkismet() |
177 | 177 | { |
178 | - if( !empty( $this->error ))return; |
|
179 | - if( !glsr( Akismet::class )->isSpam( $this->request ))return; |
|
178 | + if( !empty( $this->error )) { |
|
179 | + return; |
|
180 | + } |
|
181 | + if( !glsr( Akismet::class )->isSpam( $this->request )) { |
|
182 | + return; |
|
183 | + } |
|
180 | 184 | $this->setSessionValues( 'errors', [], 'Akismet caught a spam submission (consider adding the IP address to the blacklist):' ); |
181 | 185 | $this->error = __( 'This review has been flagged as possible spam and cannot be submitted.', 'site-reviews' ); |
182 | 186 | } |
@@ -186,8 +190,12 @@ discard block |
||
186 | 190 | */ |
187 | 191 | protected function validateBlacklist() |
188 | 192 | { |
189 | - if( !empty( $this->error ))return; |
|
190 | - if( !glsr( Blacklist::class )->isBlacklisted( $this->request ))return; |
|
193 | + if( !empty( $this->error )) { |
|
194 | + return; |
|
195 | + } |
|
196 | + if( !glsr( Blacklist::class )->isBlacklisted( $this->request )) { |
|
197 | + return; |
|
198 | + } |
|
191 | 199 | $blacklistAction = $this->getOption( 'settings.submissions.blacklist.action' ); |
192 | 200 | if( $blacklistAction == 'reject' ) { |
193 | 201 | $this->setSessionValues( 'errors', [], 'Blacklisted submission detected:' ); |
@@ -202,9 +210,13 @@ discard block |
||
202 | 210 | */ |
203 | 211 | protected function validateCustom() |
204 | 212 | { |
205 | - if( !empty( $this->error ))return; |
|
213 | + if( !empty( $this->error )) { |
|
214 | + return; |
|
215 | + } |
|
206 | 216 | $validated = apply_filters( 'site-reviews/validate/custom', true, $this->request ); |
207 | - if( $validated === true )return; |
|
217 | + if( $validated === true ) { |
|
218 | + return; |
|
219 | + } |
|
208 | 220 | $this->setSessionValues( 'errors', [] ); |
209 | 221 | $this->setSessionValues( 'values', $this->request ); |
210 | 222 | $this->error = is_string( $validated ) |
@@ -217,8 +229,12 @@ discard block |
||
217 | 229 | */ |
218 | 230 | protected function validateHoneyPot() |
219 | 231 | { |
220 | - if( !empty( $this->error ))return; |
|
221 | - if( empty( $this->request['gotcha'] ))return; |
|
232 | + if( !empty( $this->error )) { |
|
233 | + return; |
|
234 | + } |
|
235 | + if( empty( $this->request['gotcha'] )) { |
|
236 | + return; |
|
237 | + } |
|
222 | 238 | $this->setSessionValues( 'errors', [], 'The Honeypot caught a bad submission:' ); |
223 | 239 | $this->error = __( 'The review submission failed. Please notify the site administrator.', 'site-reviews' ); |
224 | 240 | } |
@@ -228,9 +244,13 @@ discard block |
||
228 | 244 | */ |
229 | 245 | protected function validateRecaptcha() |
230 | 246 | { |
231 | - if( !empty( $this->error ))return; |
|
247 | + if( !empty( $this->error )) { |
|
248 | + return; |
|
249 | + } |
|
232 | 250 | $status = $this->getRecaptchaStatus(); |
233 | - if( in_array( $status, [static::RECAPTCHA_DISABLED, static::RECAPTCHA_VALID] ))return; |
|
251 | + if( in_array( $status, [static::RECAPTCHA_DISABLED, static::RECAPTCHA_VALID] )) { |
|
252 | + return; |
|
253 | + } |
|
234 | 254 | if( $status == static::RECAPTCHA_EMPTY ) { |
235 | 255 | $this->setSessionValues( 'recaptcha', 'unset' ); |
236 | 256 | $this->recaptchaIsUnset = true; |
@@ -91,7 +91,9 @@ discard block |
||
91 | 91 | { |
92 | 92 | add_meta_box( Application::ID.'_assigned_to', __( 'Assigned To', 'site-reviews' ), [$this, 'renderAssignedToMetabox'], null, 'side' ); |
93 | 93 | add_meta_box( Application::ID.'_review', __( 'Details', 'site-reviews' ), [$this, 'renderDetailsMetaBox'], null, 'side' ); |
94 | - if( get_post_meta( $post->ID, 'review_type', true ) != 'local' )return; |
|
94 | + if( get_post_meta( $post->ID, 'review_type', true ) != 'local' ) { |
|
95 | + return; |
|
96 | + } |
|
95 | 97 | add_meta_box( Application::ID.'_response', __( 'Respond Publicly', 'site-reviews' ), [$this, 'renderResponseMetaBox'], null, 'normal' ); |
96 | 98 | } |
97 | 99 | |
@@ -127,7 +129,9 @@ discard block |
||
127 | 129 | */ |
128 | 130 | public function renderAssignedToMetabox( WP_Post $post ) |
129 | 131 | { |
130 | - if( !$this->isReviewPostType( $post ))return; |
|
132 | + if( !$this->isReviewPostType( $post )) { |
|
133 | + return; |
|
134 | + } |
|
131 | 135 | $assignedTo = (string)get_post_meta( $post->ID, 'assigned_to', true ); |
132 | 136 | wp_nonce_field( 'assigned_to', '_nonce-assigned-to', false ); |
133 | 137 | glsr()->render( 'partials/editor/metabox-assigned-to', [ |
@@ -142,7 +146,9 @@ discard block |
||
142 | 146 | */ |
143 | 147 | public function renderDetailsMetaBox( WP_Post $post ) |
144 | 148 | { |
145 | - if( !$this->isReviewPostType( $post ))return; |
|
149 | + if( !$this->isReviewPostType( $post )) { |
|
150 | + return; |
|
151 | + } |
|
146 | 152 | $review = glsr( ReviewManager::class )->single( $post ); |
147 | 153 | glsr()->render( 'partials/editor/metabox-details', [ |
148 | 154 | 'button' => $this->buildDetailsMetaBoxRevertButton( $review, $post ), |
@@ -156,7 +162,9 @@ discard block |
||
156 | 162 | */ |
157 | 163 | public function renderPinnedInPublishMetaBox() |
158 | 164 | { |
159 | - if( !$this->isReviewPostType( get_post() ))return; |
|
165 | + if( !$this->isReviewPostType( get_post() )) { |
|
166 | + return; |
|
167 | + } |
|
160 | 168 | glsr( Template::class )->render( 'partials/editor/pinned', [ |
161 | 169 | 'context' => [ |
162 | 170 | 'no' => __( 'No', 'site-reviews' ), |
@@ -172,7 +180,9 @@ discard block |
||
172 | 180 | */ |
173 | 181 | public function renderResponseMetaBox( WP_Post $post ) |
174 | 182 | { |
175 | - if( !$this->isReviewPostType( $post ))return; |
|
183 | + if( !$this->isReviewPostType( $post )) { |
|
184 | + return; |
|
185 | + } |
|
176 | 186 | wp_nonce_field( 'response', '_nonce-response', false ); |
177 | 187 | glsr()->render( 'partials/editor/metabox-response', [ |
178 | 188 | 'response' => get_post_meta( $post->ID, 'response', true ), |
@@ -185,7 +195,9 @@ discard block |
||
185 | 195 | */ |
186 | 196 | public function renderReviewEditor( WP_Post $post ) |
187 | 197 | { |
188 | - if( !$this->isReviewPostType( $post ) || $this->isReviewEditable( $post ))return; |
|
198 | + if( !$this->isReviewPostType( $post ) || $this->isReviewEditable( $post )) { |
|
199 | + return; |
|
200 | + } |
|
189 | 201 | glsr()->render( 'partials/editor/review', [ |
190 | 202 | 'post' => $post, |
191 | 203 | 'response' => get_post_meta( $post->ID, 'response', true ), |
@@ -199,7 +211,9 @@ discard block |
||
199 | 211 | public function renderReviewFields() |
200 | 212 | { |
201 | 213 | $screen = glsr_current_screen(); |
202 | - if( $screen->base != 'post' || $screen->post_type != Application::POST_TYPE )return; |
|
214 | + if( $screen->base != 'post' || $screen->post_type != Application::POST_TYPE ) { |
|
215 | + return; |
|
216 | + } |
|
203 | 217 | add_action( 'edit_form_after_title', [$this, 'renderReviewEditor'] ); |
204 | 218 | add_action( 'edit_form_top', [$this, 'renderReviewNotice'] ); |
205 | 219 | } |
@@ -210,7 +224,9 @@ discard block |
||
210 | 224 | */ |
211 | 225 | public function renderReviewNotice( WP_Post $post ) |
212 | 226 | { |
213 | - if( !$this->isReviewPostType( $post ) || $this->isReviewEditable( $post ))return; |
|
227 | + if( !$this->isReviewPostType( $post ) || $this->isReviewEditable( $post )) { |
|
228 | + return; |
|
229 | + } |
|
214 | 230 | glsr( Notice::class )->addWarning( sprintf( |
215 | 231 | __( '%s reviews are read-only.', 'site-reviews' ), |
216 | 232 | glsr( Columns::class )->buildColumnReviewType( $post->ID ) |
@@ -229,7 +245,9 @@ discard block |
||
229 | 245 | */ |
230 | 246 | public function renderTaxonomyMetabox( WP_Post $post ) |
231 | 247 | { |
232 | - if( !$this->isReviewPostType( $post ))return; |
|
248 | + if( !$this->isReviewPostType( $post )) { |
|
249 | + return; |
|
250 | + } |
|
233 | 251 | glsr()->render( 'partials/editor/metabox-categories', [ |
234 | 252 | 'post' => $post, |
235 | 253 | 'tax_name' => Application::TAXONOMY, |
@@ -267,7 +285,9 @@ discard block |
||
267 | 285 | protected function buildAssignedToTemplate( $assignedTo, WP_Post $post ) |
268 | 286 | { |
269 | 287 | $assignedPost = glsr( Database::class )->getAssignedToPost( $post->ID, $assignedTo ); |
270 | - if( !( $assignedPost instanceof WP_Post ))return; |
|
288 | + if( !( $assignedPost instanceof WP_Post )) { |
|
289 | + return; |
|
290 | + } |
|
271 | 291 | return glsr( Template::class )->build( 'partials/editor/assigned-post', [ |
272 | 292 | 'context' => [ |
273 | 293 | 'data.url' => (string)get_permalink( $assignedPost ), |
@@ -312,7 +332,9 @@ discard block |
||
312 | 332 | */ |
313 | 333 | protected function getReviewType( $review ) |
314 | 334 | { |
315 | - if( count( glsr()->reviewTypes ) < 2 )return; |
|
335 | + if( count( glsr()->reviewTypes ) < 2 ) { |
|
336 | + return; |
|
337 | + } |
|
316 | 338 | $reviewType = array_key_exists( $review->review_type, glsr()->reviewTypes ) |
317 | 339 | ? glsr()->reviewTypes[$review->review_type] |
318 | 340 | : __( 'Unknown', 'site-reviews' ); |
@@ -60,7 +60,9 @@ discard block |
||
60 | 60 | public function catchFatalError() |
61 | 61 | { |
62 | 62 | $error = error_get_last(); |
63 | - if( $error['type'] !== E_ERROR || strpos( $error['message'], $this->path() ) === false )return; |
|
63 | + if( $error['type'] !== E_ERROR || strpos( $error['message'], $this->path() ) === false ) { |
|
64 | + return; |
|
65 | + } |
|
64 | 66 | glsr_log()->error( $error['message'] ); |
65 | 67 | } |
66 | 68 | |
@@ -111,7 +113,9 @@ discard block |
||
111 | 113 | $filePaths[] = $this->path( $view ); |
112 | 114 | $filePaths[] = $this->path( 'views/'.$view ); |
113 | 115 | foreach( $filePaths as $file ) { |
114 | - if( !file_exists( $file ))continue; |
|
116 | + if( !file_exists( $file )) { |
|
117 | + continue; |
|
118 | + } |
|
115 | 119 | return $file; |
116 | 120 | } |
117 | 121 | } |
@@ -215,7 +219,9 @@ discard block |
||
215 | 219 | */ |
216 | 220 | public function scheduleCronJob() |
217 | 221 | { |
218 | - if( wp_next_scheduled( static::CRON_EVENT ))return; |
|
222 | + if( wp_next_scheduled( static::CRON_EVENT )) { |
|
223 | + return; |
|
224 | + } |
|
219 | 225 | wp_schedule_event( time(), 'twicedaily', static::CRON_EVENT ); |
220 | 226 | } |
221 | 227 | |
@@ -255,7 +261,9 @@ discard block |
||
255 | 261 | || !in_array( plugin_basename( $this->file ), $data['plugins'] ) |
256 | 262 | || $data['action'] != 'update' |
257 | 263 | || $data['type'] != 'plugin' |
258 | - )return; |
|
264 | + ) { |
|
265 | + return; |
|
266 | + } |
|
259 | 267 | $this->upgrade(); |
260 | 268 | } |
261 | 269 |
@@ -55,7 +55,9 @@ discard block |
||
55 | 55 | } |
56 | 56 | $views = $this->generatePossibleViews( $view ); |
57 | 57 | foreach( $views as $possibleView ) { |
58 | - if( !file_exists( glsr()->file( $possibleView )))continue; |
|
58 | + if( !file_exists( glsr()->file( $possibleView ))) { |
|
59 | + continue; |
|
60 | + } |
|
59 | 61 | return glsr( Helper::class )->removePrefix( 'views/', $possibleView ); |
60 | 62 | } |
61 | 63 | return $view; |
@@ -88,7 +90,9 @@ discard block |
||
88 | 90 | */ |
89 | 91 | public function modifyField( Builder $instance ) |
90 | 92 | { |
91 | - if( !$this->isPublicInstance( $instance ) || empty( array_filter( $this->fields )))return; |
|
93 | + if( !$this->isPublicInstance( $instance ) || empty( array_filter( $this->fields ))) { |
|
94 | + return; |
|
95 | + } |
|
92 | 96 | call_user_func_array( [$this, 'customize'], [&$instance] ); |
93 | 97 | } |
94 | 98 | |
@@ -105,7 +109,9 @@ discard block |
||
105 | 109 | */ |
106 | 110 | protected function customize( Builder $instance ) |
107 | 111 | { |
108 | - if( !array_key_exists( $instance->tag, $this->fields ))return; |
|
112 | + if( !array_key_exists( $instance->tag, $this->fields )) { |
|
113 | + return; |
|
114 | + } |
|
109 | 115 | $args = wp_parse_args( $instance->args, array_fill_keys( ['class', 'type'], '' )); |
110 | 116 | $key = $instance->tag.'_'.$args['type']; |
111 | 117 | $classes = !isset( $this->fields[$key] ) |
@@ -35,7 +35,9 @@ discard block |
||
35 | 35 | foreach( glsr( ReviewManager::class )->get( $this->args ) as $review ) { |
36 | 36 | // Only include critic reviews that have been directly produced by your site, not reviews from third- party sites or syndicated reviews. |
37 | 37 | // @see https://developers.google.com/search/docs/data-types/review |
38 | - if( $review->review_type != 'local' )continue; |
|
38 | + if( $review->review_type != 'local' ) { |
|
39 | + continue; |
|
40 | + } |
|
39 | 41 | $reviews[] = $this->buildReview( $review ); |
40 | 42 | } |
41 | 43 | if( !empty( $reviews )) { |
@@ -80,7 +82,9 @@ discard block |
||
80 | 82 | */ |
81 | 83 | public function render() |
82 | 84 | { |
83 | - if( empty( glsr()->schemas ))return; |
|
85 | + if( empty( glsr()->schemas )) { |
|
86 | + return; |
|
87 | + } |
|
84 | 88 | printf( '<script type="application/ld+json">%s</script>', json_encode( |
85 | 89 | apply_filters( 'site-reviews/schema/all', glsr()->schemas ), |
86 | 90 | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES |
@@ -132,7 +136,9 @@ discard block |
||
132 | 136 | { |
133 | 137 | foreach( $values as $value ) { |
134 | 138 | $option = $this->getSchemaOptionValue( $value ); |
135 | - if( empty( $option ))continue; |
|
139 | + if( empty( $option )) { |
|
140 | + continue; |
|
141 | + } |
|
136 | 142 | $schema->$value( $option ); |
137 | 143 | } |
138 | 144 | return $schema; |
@@ -242,7 +248,9 @@ discard block |
||
242 | 248 | if( $value != $fallback ) { |
243 | 249 | return $value; |
244 | 250 | } |
245 | - if( !is_single() && !is_page() )return; |
|
251 | + if( !is_single() && !is_page() ) { |
|
252 | + return; |
|
253 | + } |
|
246 | 254 | $method = glsr( Helper::class )->buildMethodName( $option, 'getThing' ); |
247 | 255 | if( method_exists( $this, $method )) { |
248 | 256 | return $this->$method(); |
@@ -69,7 +69,9 @@ discard block |
||
69 | 69 | $field = method_exists( $this, $method ) |
70 | 70 | ? $this->$method( $key, $value ) |
71 | 71 | : apply_filters( 'site-reviews/review/build/'.$key, false, $value, $this, $review ); |
72 | - if( $field === false )continue; |
|
72 | + if( $field === false ) { |
|
73 | + continue; |
|
74 | + } |
|
73 | 75 | $renderedFields[$key] = $field; |
74 | 76 | } |
75 | 77 | $this->wrap( $renderedFields, $review ); |
@@ -97,7 +99,9 @@ discard block |
||
97 | 99 | */ |
98 | 100 | public function generateSchema() |
99 | 101 | { |
100 | - if( !wp_validate_boolean( $this->args['schema'] ))return; |
|
102 | + if( !wp_validate_boolean( $this->args['schema'] )) { |
|
103 | + return; |
|
104 | + } |
|
101 | 105 | glsr( Schema::class )->store( |
102 | 106 | glsr( Schema::class )->build( $this->args ) |
103 | 107 | ); |
@@ -123,9 +127,13 @@ discard block |
||
123 | 127 | */ |
124 | 128 | protected function buildOptionAssignedTo( $key, $value ) |
125 | 129 | { |
126 | - if( $this->isHidden( $key, 'settings.reviews.assigned_links' ))return; |
|
130 | + if( $this->isHidden( $key, 'settings.reviews.assigned_links' )) { |
|
131 | + return; |
|
132 | + } |
|
127 | 133 | $post = glsr( Polylang::class )->getPost( $value ); |
128 | - if( !( $post instanceof WP_Post ))return; |
|
134 | + if( !( $post instanceof WP_Post )) { |
|
135 | + return; |
|
136 | + } |
|
129 | 137 | $permalink = glsr( Builder::class )->a( get_the_title( $post->ID ), [ |
130 | 138 | 'href' => get_the_permalink( $post->ID ), |
131 | 139 | ]); |
@@ -140,7 +148,9 @@ discard block |
||
140 | 148 | */ |
141 | 149 | protected function buildOptionAuthor( $key, $value ) |
142 | 150 | { |
143 | - if( $this->isHidden( $key ))return; |
|
151 | + if( $this->isHidden( $key )) { |
|
152 | + return; |
|
153 | + } |
|
144 | 154 | return '<span>'.$value.'</span>'; |
145 | 155 | } |
146 | 156 | |
@@ -151,7 +161,9 @@ discard block |
||
151 | 161 | */ |
152 | 162 | protected function buildOptionAvatar( $key, $value ) |
153 | 163 | { |
154 | - if( $this->isHidden( $key, 'settings.reviews.avatars' ))return; |
|
164 | + if( $this->isHidden( $key, 'settings.reviews.avatars' )) { |
|
165 | + return; |
|
166 | + } |
|
155 | 167 | $size = $this->getOption( 'settings.reviews.avatars_size', 40 ); |
156 | 168 | return glsr( Builder::class )->img([ |
157 | 169 | 'height' => $size, |
@@ -169,7 +181,9 @@ discard block |
||
169 | 181 | protected function buildOptionContent( $key, $value ) |
170 | 182 | { |
171 | 183 | $text = $this->normalizeText( $value ); |
172 | - if( $this->isHiddenOrEmpty( $key, $text ))return; |
|
184 | + if( $this->isHiddenOrEmpty( $key, $text )) { |
|
185 | + return; |
|
186 | + } |
|
173 | 187 | return '<p>'.$text.'</p>'; |
174 | 188 | } |
175 | 189 | |
@@ -180,7 +194,9 @@ discard block |
||
180 | 194 | */ |
181 | 195 | protected function buildOptionDate( $key, $value ) |
182 | 196 | { |
183 | - if( $this->isHidden( $key ))return; |
|
197 | + if( $this->isHidden( $key )) { |
|
198 | + return; |
|
199 | + } |
|
184 | 200 | $dateFormat = $this->getOption( 'settings.reviews.date.format', 'default' ); |
185 | 201 | if( $dateFormat == 'relative' ) { |
186 | 202 | $date = glsr( Date::class )->relative( $value ); |
@@ -201,7 +217,9 @@ discard block |
||
201 | 217 | */ |
202 | 218 | protected function buildOptionRating( $key, $value ) |
203 | 219 | { |
204 | - if( $this->isHiddenOrEmpty( $key, $value ))return; |
|
220 | + if( $this->isHiddenOrEmpty( $key, $value )) { |
|
221 | + return; |
|
222 | + } |
|
205 | 223 | return glsr( Partial::class )->build( 'star-rating', [ |
206 | 224 | 'rating' => $value, |
207 | 225 | ]); |
@@ -214,7 +232,9 @@ discard block |
||
214 | 232 | */ |
215 | 233 | protected function buildOptionResponse( $key, $value ) |
216 | 234 | { |
217 | - if( $this->isHiddenOrEmpty( $key, $value ))return; |
|
235 | + if( $this->isHiddenOrEmpty( $key, $value )) { |
|
236 | + return; |
|
237 | + } |
|
218 | 238 | $title = sprintf( __( 'Response from %s', 'site-reviews' ), get_bloginfo( 'name' )); |
219 | 239 | $text = $this->normalizeText( $value ); |
220 | 240 | $text = '<p><strong>'.$title.'</strong></p><p>'.$text.'</p>'; |
@@ -230,7 +250,9 @@ discard block |
||
230 | 250 | */ |
231 | 251 | protected function buildOptionTitle( $key, $value ) |
232 | 252 | { |
233 | - if( $this->isHidden( $key ))return; |
|
253 | + if( $this->isHidden( $key )) { |
|
254 | + return; |
|
255 | + } |
|
234 | 256 | if( empty( $value )) { |
235 | 257 | $value = __( 'No Title', 'site-reviews' ); |
236 | 258 | } |
@@ -289,9 +311,13 @@ discard block |
||
289 | 311 | $words->setText( $text ); |
290 | 312 | $count = 0; |
291 | 313 | foreach( $words as $offset ){ |
292 | - if( $words->getRuleStatus() === IntlRuleBasedBreakIterator::WORD_NONE )continue; |
|
314 | + if( $words->getRuleStatus() === IntlRuleBasedBreakIterator::WORD_NONE ) { |
|
315 | + continue; |
|
316 | + } |
|
293 | 317 | $count++; |
294 | - if( $count != $limit )continue; |
|
318 | + if( $count != $limit ) { |
|
319 | + continue; |
|
320 | + } |
|
295 | 321 | return $offset; |
296 | 322 | } |
297 | 323 | return strlen( $text ); |
@@ -367,7 +393,9 @@ discard block |
||
367 | 393 | $renderedFields = apply_filters( 'site-reviews/review/wrap', $renderedFields, $review ); |
368 | 394 | array_walk( $renderedFields, function( &$value, $key ) use( $review ) { |
369 | 395 | $value = apply_filters( 'site-reviews/review/wrap/'.$key, $value, $review ); |
370 | - if( empty( $value ))return; |
|
396 | + if( empty( $value )) { |
|
397 | + return; |
|
398 | + } |
|
371 | 399 | $value = glsr( Builder::class )->div( $value, [ |
372 | 400 | 'class' => 'glsr-review-'.$key, |
373 | 401 | ]); |
@@ -33,7 +33,9 @@ |
||
33 | 33 | */ |
34 | 34 | public function __toString() |
35 | 35 | { |
36 | - if( empty( $this->values ))return; |
|
36 | + if( empty( $this->values )) { |
|
37 | + return; |
|
38 | + } |
|
37 | 39 | return glsr( Template::class )->build( 'templates/review', [ |
38 | 40 | 'context' => $this->values, |
39 | 41 | ]); |
@@ -123,7 +123,9 @@ discard block |
||
123 | 123 | $termId = intval( $termId ); |
124 | 124 | } |
125 | 125 | $term = term_exists( $termId, Application::TAXONOMY ); |
126 | - if( !isset( $term['term_id'] ))continue; |
|
126 | + if( !isset( $term['term_id'] )) { |
|
127 | + continue; |
|
128 | + } |
|
127 | 129 | $terms[] = $term; |
128 | 130 | } |
129 | 131 | return $terms; |
@@ -135,7 +137,9 @@ discard block |
||
135 | 137 | */ |
136 | 138 | public function revert( $postId ) |
137 | 139 | { |
138 | - if( get_post_field( 'post_type', $postId ) != Application::POST_TYPE )return; |
|
140 | + if( get_post_field( 'post_type', $postId ) != Application::POST_TYPE ) { |
|
141 | + return; |
|
142 | + } |
|
139 | 143 | delete_post_meta( $postId, '_edit_last' ); |
140 | 144 | $result = wp_update_post([ |
141 | 145 | 'ID' => $postId, |
@@ -180,7 +184,9 @@ discard block |
||
180 | 184 | protected function setTerms( $postId, $termIds ) |
181 | 185 | { |
182 | 186 | $terms = $this->normalizeTermIds( $termIds ); |
183 | - if( empty( $terms ))return; |
|
187 | + if( empty( $terms )) { |
|
188 | + return; |
|
189 | + } |
|
184 | 190 | $result = wp_set_object_terms( $postId, $terms, Application::TAXONOMY ); |
185 | 191 | if( is_wp_error( $result )) { |
186 | 192 | glsr_log()->error( $result->get_error_message() ); |