@@ -82,7 +82,9 @@ discard block |
||
| 82 | 82 | $reviewValues = []; |
| 83 | 83 | foreach( $review as $key => $value ) { |
| 84 | 84 | $method = glsr( Helper::class )->buildMethodName( $key, 'buildOption' ); |
| 85 | - if( !method_exists( $this, $method ))continue; |
|
| 85 | + if( !method_exists( $this, $method )) { |
|
| 86 | + continue; |
|
| 87 | + } |
|
| 86 | 88 | $reviewValues[$key] = $this->$method( $key, $value ); |
| 87 | 89 | } |
| 88 | 90 | $reviewValues = apply_filters( 'site-reviews/review/build/after', $reviewValues ); |
@@ -96,9 +98,13 @@ discard block |
||
| 96 | 98 | */ |
| 97 | 99 | protected function buildOptionAssignedTo( $key, $value ) |
| 98 | 100 | { |
| 99 | - if( $this->isHiddenOrEmpty( $key, 'settings.reviews.assigned_links.enabled' ))return; |
|
| 101 | + if( $this->isHiddenOrEmpty( $key, 'settings.reviews.assigned_links.enabled' )) { |
|
| 102 | + return; |
|
| 103 | + } |
|
| 100 | 104 | $post = get_post( intval( $value )); |
| 101 | - if( !( $post instanceof WP_Post ))return; |
|
| 105 | + if( !( $post instanceof WP_Post )) { |
|
| 106 | + return; |
|
| 107 | + } |
|
| 102 | 108 | $permalink = glsr( Builder::class )->a( get_the_title( $post->ID ), [ |
| 103 | 109 | 'href' => get_the_permalink( $post->ID ), |
| 104 | 110 | ]); |
@@ -113,7 +119,9 @@ discard block |
||
| 113 | 119 | */ |
| 114 | 120 | protected function buildOptionAuthor( $key, $value ) |
| 115 | 121 | { |
| 116 | - if( $this->isHidden( $key ))return; |
|
| 122 | + if( $this->isHidden( $key )) { |
|
| 123 | + return; |
|
| 124 | + } |
|
| 117 | 125 | $prefix = !$this->isOptionEnabled( 'settings.reviews.avatars.enabled' ) |
| 118 | 126 | ? apply_filters( 'site-reviews/review/author/prefix', '—' ) |
| 119 | 127 | : ''; |
@@ -127,7 +135,9 @@ discard block |
||
| 127 | 135 | */ |
| 128 | 136 | protected function buildOptionAvatar( $key, $value ) |
| 129 | 137 | { |
| 130 | - if( $this->isHidden( $key, 'settings.reviews.avatars.enabled' ))return; |
|
| 138 | + if( $this->isHidden( $key, 'settings.reviews.avatars.enabled' )) { |
|
| 139 | + return; |
|
| 140 | + } |
|
| 131 | 141 | $size = $this->getOption( 'settings.reviews.avatars.size', 40 ); |
| 132 | 142 | return $this->wrap( $key, glsr( Builder::class )->img([ |
| 133 | 143 | 'src' => $this->generateAvatar( $value ), |
@@ -144,7 +154,9 @@ discard block |
||
| 144 | 154 | protected function buildOptionContent( $key, $value ) |
| 145 | 155 | { |
| 146 | 156 | $text = $this->normalizeText( $value ); |
| 147 | - if( $this->isHiddenOrEmpty( $key, $text ))return; |
|
| 157 | + if( $this->isHiddenOrEmpty( $key, $text )) { |
|
| 158 | + return; |
|
| 159 | + } |
|
| 148 | 160 | return $this->wrap( $key, '<p>'.$text.'</p>' ); |
| 149 | 161 | } |
| 150 | 162 | |
@@ -155,7 +167,9 @@ discard block |
||
| 155 | 167 | */ |
| 156 | 168 | protected function buildOptionDate( $key, $value ) |
| 157 | 169 | { |
| 158 | - if( $this->isHidden( $key ))return; |
|
| 170 | + if( $this->isHidden( $key )) { |
|
| 171 | + return; |
|
| 172 | + } |
|
| 159 | 173 | $dateFormat = $this->getOption( 'settings.reviews.date.format', 'default' ); |
| 160 | 174 | if( $dateFormat == 'relative' ) { |
| 161 | 175 | $date = glsr( Date::class )->relative( $value ); |
@@ -176,7 +190,9 @@ discard block |
||
| 176 | 190 | */ |
| 177 | 191 | protected function buildOptionRating( $key, $value ) |
| 178 | 192 | { |
| 179 | - if( $this->isHiddenOrEmpty( $key, $value ))return; |
|
| 193 | + if( $this->isHiddenOrEmpty( $key, $value )) { |
|
| 194 | + return; |
|
| 195 | + } |
|
| 180 | 196 | $rating = glsr( Html::class )->buildPartial( 'star-rating', [ |
| 181 | 197 | 'rating' => $value, |
| 182 | 198 | ]); |
@@ -190,7 +206,9 @@ discard block |
||
| 190 | 206 | */ |
| 191 | 207 | protected function buildOptionResponse( $key, $value ) |
| 192 | 208 | { |
| 193 | - if( $this->isHiddenOrEmpty( $key, $value ))return; |
|
| 209 | + if( $this->isHiddenOrEmpty( $key, $value )) { |
|
| 210 | + return; |
|
| 211 | + } |
|
| 194 | 212 | $title = sprintf( __( 'Response from %s', 'site-reviews' ), get_bloginfo( 'name' )); |
| 195 | 213 | $text = $this->normalizeText( $value ); |
| 196 | 214 | $text = '<p><strong>'.$title.'</strong></p><p>'.$text.'</p>'; |
@@ -207,7 +225,9 @@ discard block |
||
| 207 | 225 | */ |
| 208 | 226 | protected function buildOptionTitle( $key, $value ) |
| 209 | 227 | { |
| 210 | - if( $this->isHidden( $key ))return; |
|
| 228 | + if( $this->isHidden( $key )) { |
|
| 229 | + return; |
|
| 230 | + } |
|
| 211 | 231 | if( empty( $value )) { |
| 212 | 232 | $value = __( 'No Title', 'site-reviews' ); |
| 213 | 233 | } |
@@ -237,7 +257,9 @@ discard block |
||
| 237 | 257 | */ |
| 238 | 258 | protected function generateSchema() |
| 239 | 259 | { |
| 240 | - if( !wp_validate_boolean( $this->args['schema'] ))return; |
|
| 260 | + if( !wp_validate_boolean( $this->args['schema'] )) { |
|
| 261 | + return; |
|
| 262 | + } |
|
| 241 | 263 | glsr( Schema::class )->store( |
| 242 | 264 | glsr( Schema::class )->build( $this->args ) |
| 243 | 265 | ); |
@@ -302,7 +324,9 @@ discard block |
||
| 302 | 324 | $count = 0; |
| 303 | 325 | $break = strlen( $text ); |
| 304 | 326 | foreach( $words as $offset ){ |
| 305 | - if( \IntlBreakIterator::WORD_NONE === $words->getRuleStatus() )continue; |
|
| 327 | + if( \IntlBreakIterator::WORD_NONE === $words->getRuleStatus() ) { |
|
| 328 | + continue; |
|
| 329 | + } |
|
| 306 | 330 | $count++; |
| 307 | 331 | if( $count == $limit ) { |
| 308 | 332 | $break = $offset; |