@@ -33,7 +33,7 @@ |
||
| 33 | 33 | : []; |
| 34 | 34 | $values = apply_filters( 'site-reviews/form/fields', $values ); |
| 35 | 35 | foreach( $values as $name => $field ) { |
| 36 | - $fields[] = new Field( wp_parse_args( $field, ['name' => $name] )); |
|
| 36 | + $fields[] = new Field( wp_parse_args( $field, ['name' => $name] ) ); |
|
| 37 | 37 | } |
| 38 | 38 | return $fields; |
| 39 | 39 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | 'navigation' => $navigation, |
| 58 | 58 | ], |
| 59 | 59 | 'reviews' => $this->buildReviews(), |
| 60 | - ]); |
|
| 60 | + ] ); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $reviewValues = []; |
| 84 | 84 | foreach( $review as $key => $value ) { |
| 85 | 85 | $method = glsr( Helper::class )->buildMethodName( $key, 'buildOption' ); |
| 86 | - if( !method_exists( $this, $method ))continue; |
|
| 86 | + if( !method_exists( $this, $method ) )continue; |
|
| 87 | 87 | $reviewValues[$key] = $this->$method( $key, $value ); |
| 88 | 88 | } |
| 89 | 89 | $reviewValues = apply_filters( 'site-reviews/review/build/after', $reviewValues ); |
@@ -97,12 +97,12 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | protected function buildOptionAssignedTo( $key, $value ) |
| 99 | 99 | { |
| 100 | - if( $this->isHiddenOrEmpty( $key, 'settings.reviews.assigned_links.enabled' ))return; |
|
| 101 | - $post = get_post( intval( $value )); |
|
| 102 | - if( !( $post instanceof WP_Post ))return; |
|
| 100 | + if( $this->isHiddenOrEmpty( $key, 'settings.reviews.assigned_links.enabled' ) )return; |
|
| 101 | + $post = get_post( intval( $value ) ); |
|
| 102 | + if( !($post instanceof WP_Post) )return; |
|
| 103 | 103 | $permalink = glsr( Builder::class )->a( get_the_title( $post->ID ), [ |
| 104 | 104 | 'href' => get_the_permalink( $post->ID ), |
| 105 | - ]); |
|
| 105 | + ] ); |
|
| 106 | 106 | $assignedTo = sprintf( __( 'Review of %s', 'site-reviews' ), $permalink ); |
| 107 | 107 | return $this->wrap( $key, '<span>'.$assignedTo.'</span>' ); |
| 108 | 108 | } |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | protected function buildOptionAuthor( $key, $value ) |
| 116 | 116 | { |
| 117 | - if( $this->isHidden( $key ))return; |
|
| 117 | + if( $this->isHidden( $key ) )return; |
|
| 118 | 118 | $prefix = !$this->isOptionEnabled( 'settings.reviews.avatars.enabled' ) |
| 119 | 119 | ? apply_filters( 'site-reviews/review/author/prefix', '—' ) |
| 120 | 120 | : ''; |
@@ -128,13 +128,13 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | protected function buildOptionAvatar( $key, $value ) |
| 130 | 130 | { |
| 131 | - if( $this->isHidden( $key, 'settings.reviews.avatars.enabled' ))return; |
|
| 131 | + if( $this->isHidden( $key, 'settings.reviews.avatars.enabled' ) )return; |
|
| 132 | 132 | $size = $this->getOption( 'settings.reviews.avatars.size', 40 ); |
| 133 | - return $this->wrap( $key, glsr( Builder::class )->img([ |
|
| 133 | + return $this->wrap( $key, glsr( Builder::class )->img( [ |
|
| 134 | 134 | 'src' => $this->generateAvatar( $value ), |
| 135 | 135 | 'height' => $size, |
| 136 | 136 | 'width' => $size, |
| 137 | - ])); |
|
| 137 | + ] ) ); |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | protected function buildOptionContent( $key, $value ) |
| 146 | 146 | { |
| 147 | 147 | $text = $this->normalizeText( $value ); |
| 148 | - if( $this->isHiddenOrEmpty( $key, $text ))return; |
|
| 148 | + if( $this->isHiddenOrEmpty( $key, $text ) )return; |
|
| 149 | 149 | return $this->wrap( $key, '<p>'.$text.'</p>' ); |
| 150 | 150 | } |
| 151 | 151 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | */ |
| 157 | 157 | protected function buildOptionDate( $key, $value ) |
| 158 | 158 | { |
| 159 | - if( $this->isHidden( $key ))return; |
|
| 159 | + if( $this->isHidden( $key ) )return; |
|
| 160 | 160 | $dateFormat = $this->getOption( 'settings.reviews.date.format', 'default' ); |
| 161 | 161 | if( $dateFormat == 'relative' ) { |
| 162 | 162 | $date = glsr( Date::class )->relative( $value ); |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | $format = $dateFormat == 'custom' |
| 166 | 166 | ? $this->getOption( 'settings.reviews.date.custom', 'M j, Y' ) |
| 167 | 167 | : (string)get_option( 'date_format' ); |
| 168 | - $date = date_i18n( $format, strtotime( $value )); |
|
| 168 | + $date = date_i18n( $format, strtotime( $value ) ); |
|
| 169 | 169 | } |
| 170 | 170 | return $this->wrap( $key, '<span>'.$date.'</span>' ); |
| 171 | 171 | } |
@@ -177,10 +177,10 @@ discard block |
||
| 177 | 177 | */ |
| 178 | 178 | protected function buildOptionRating( $key, $value ) |
| 179 | 179 | { |
| 180 | - if( $this->isHiddenOrEmpty( $key, $value ))return; |
|
| 180 | + if( $this->isHiddenOrEmpty( $key, $value ) )return; |
|
| 181 | 181 | $rating = glsr( Html::class )->buildPartial( 'star-rating', [ |
| 182 | 182 | 'rating' => $value, |
| 183 | - ]); |
|
| 183 | + ] ); |
|
| 184 | 184 | return $this->wrap( $key, $rating ); |
| 185 | 185 | } |
| 186 | 186 | |
@@ -191,8 +191,8 @@ discard block |
||
| 191 | 191 | */ |
| 192 | 192 | protected function buildOptionResponse( $key, $value ) |
| 193 | 193 | { |
| 194 | - if( $this->isHiddenOrEmpty( $key, $value ))return; |
|
| 195 | - $title = sprintf( __( 'Response from %s', 'site-reviews' ), get_bloginfo( 'name' )); |
|
| 194 | + if( $this->isHiddenOrEmpty( $key, $value ) )return; |
|
| 195 | + $title = sprintf( __( 'Response from %s', 'site-reviews' ), get_bloginfo( 'name' ) ); |
|
| 196 | 196 | $text = $this->normalizeText( $value ); |
| 197 | 197 | $text = '<p><strong>'.$title.'</strong></p><p>'.$text.'</p>'; |
| 198 | 198 | return $this->wrap( $key, |
@@ -208,8 +208,8 @@ discard block |
||
| 208 | 208 | */ |
| 209 | 209 | protected function buildOptionTitle( $key, $value ) |
| 210 | 210 | { |
| 211 | - if( $this->isHidden( $key ))return; |
|
| 212 | - if( empty( $value )) { |
|
| 211 | + if( $this->isHidden( $key ) )return; |
|
| 212 | + if( empty($value) ) { |
|
| 213 | 213 | $value = __( 'No Title', 'site-reviews' ); |
| 214 | 214 | } |
| 215 | 215 | return $this->wrap( $key, '<h3>'.$value.'</h3>' ); |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | return $avatarUrl; |
| 228 | 228 | } |
| 229 | 229 | $authorIdOrEmail = get_the_author_meta( 'ID', $review->user_id ); |
| 230 | - if( empty( $authorIdOrEmail )) { |
|
| 230 | + if( empty($authorIdOrEmail) ) { |
|
| 231 | 231 | $authorIdOrEmail = $review->email; |
| 232 | 232 | } |
| 233 | 233 | return (string)get_avatar_url( $authorIdOrEmail ); |
@@ -238,7 +238,7 @@ discard block |
||
| 238 | 238 | */ |
| 239 | 239 | protected function generateSchema() |
| 240 | 240 | { |
| 241 | - if( !wp_validate_boolean( $this->args['schema'] ))return; |
|
| 241 | + if( !wp_validate_boolean( $this->args['schema'] ) )return; |
|
| 242 | 242 | glsr( Schema::class )->store( |
| 243 | 243 | glsr( Schema::class )->build( $this->args ) |
| 244 | 244 | ); |
@@ -262,18 +262,18 @@ discard block |
||
| 262 | 262 | */ |
| 263 | 263 | protected function getExcerpt( $text ) |
| 264 | 264 | { |
| 265 | - $limit = intval( $this->getOption( 'settings.reviews.excerpt.length', 55 )); |
|
| 265 | + $limit = intval( $this->getOption( 'settings.reviews.excerpt.length', 55 ) ); |
|
| 266 | 266 | $split = extension_loaded( 'intl' ) |
| 267 | 267 | ? $this->getExcerptIntlSplit( $text, $limit ) |
| 268 | 268 | : $this->getExcerptSplit( $text, $limit ); |
| 269 | 269 | $hiddenText = substr( $text, $split ); |
| 270 | - if( !empty( $hiddenText )) { |
|
| 270 | + if( !empty($hiddenText) ) { |
|
| 271 | 271 | $showMore = glsr( Builder::class )->span( $hiddenText, [ |
| 272 | 272 | 'class' => 'glsr-hidden glsr-hidden-text', |
| 273 | 273 | 'data-show-less' => __( 'Show less', 'site-reviews' ), |
| 274 | 274 | 'data-show-more' => __( 'Show more', 'site-reviews' ), |
| 275 | - ]); |
|
| 276 | - $text = ltrim( substr( $text, 0, $split )).$showMore; |
|
| 275 | + ] ); |
|
| 276 | + $text = ltrim( substr( $text, 0, $split ) ).$showMore; |
|
| 277 | 277 | } |
| 278 | 278 | return nl2br( $text ); |
| 279 | 279 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | $words = IntlRuleBasedBreakIterator::createWordInstance( '' ); |
| 289 | 289 | $words->setText( $text ); |
| 290 | 290 | $count = 0; |
| 291 | - foreach( $words as $offset ){ |
|
| 291 | + foreach( $words as $offset ) { |
|
| 292 | 292 | if( $words->getRuleStatus() === IntlRuleBasedBreakIterator::WORD_NONE )continue; |
| 293 | 293 | $count++; |
| 294 | 294 | if( $count != $limit )continue; |
@@ -305,7 +305,7 @@ discard block |
||
| 305 | 305 | protected function getExcerptSplit( $text, $limit ) |
| 306 | 306 | { |
| 307 | 307 | if( str_word_count( $text, 0 ) > $limit ) { |
| 308 | - $words = array_keys( str_word_count( $text, 2 )); |
|
| 308 | + $words = array_keys( str_word_count( $text, 2 ) ); |
|
| 309 | 309 | return $words[$limit]; |
| 310 | 310 | } |
| 311 | 311 | return strlen( $text ); |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | */ |
| 319 | 319 | protected function getOption( $path, $fallback = '' ) |
| 320 | 320 | { |
| 321 | - if( array_key_exists( $path, $this->options )) { |
|
| 321 | + if( array_key_exists( $path, $this->options ) ) { |
|
| 322 | 322 | return $this->options[$path]; |
| 323 | 323 | } |
| 324 | 324 | return $fallback; |
@@ -331,7 +331,7 @@ discard block |
||
| 331 | 331 | */ |
| 332 | 332 | protected function isHidden( $key, $path = '' ) |
| 333 | 333 | { |
| 334 | - $isOptionEnabled = !empty( $path ) |
|
| 334 | + $isOptionEnabled = !empty($path) |
|
| 335 | 335 | ? $this->isOptionEnabled( $path ) |
| 336 | 336 | : true; |
| 337 | 337 | return in_array( $key, $this->args['hide'] ) || !$isOptionEnabled; |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | */ |
| 345 | 345 | protected function isHiddenOrEmpty( $key, $value ) |
| 346 | 346 | { |
| 347 | - return $this->isHidden( $key ) || empty( $value ); |
|
| 347 | + return $this->isHidden( $key ) || empty($value); |
|
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | /** |
@@ -363,10 +363,10 @@ discard block |
||
| 363 | 363 | protected function normalizeText( $text ) |
| 364 | 364 | { |
| 365 | 365 | $text = wp_kses( $text, wp_kses_allowed_html() ); |
| 366 | - $text = convert_smilies( strip_shortcodes( $text )); |
|
| 366 | + $text = convert_smilies( strip_shortcodes( $text ) ); |
|
| 367 | 367 | $text = str_replace( ']]>', ']]>', $text ); |
| 368 | 368 | $text = preg_replace( '/(\R){2,}/', '$1', $text ); |
| 369 | - if( $this->isOptionEnabled( 'settings.reviews.excerpt.enabled' )) { |
|
| 369 | + if( $this->isOptionEnabled( 'settings.reviews.excerpt.enabled' ) ) { |
|
| 370 | 370 | $text = $this->getExcerpt( $text ); |
| 371 | 371 | } |
| 372 | 372 | return wptexturize( $text ); |
@@ -381,6 +381,6 @@ discard block |
||
| 381 | 381 | { |
| 382 | 382 | return glsr( Builder::class )->div( $value, [ |
| 383 | 383 | 'class' => 'glsr-review-'.$key, |
| 384 | - ]); |
|
| 384 | + ] ); |
|
| 385 | 385 | } |
| 386 | 386 | } |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | */ |
| 109 | 109 | public function get() |
| 110 | 110 | { |
| 111 | - return empty( $this->log ) |
|
| 111 | + return empty($this->log) |
|
| 112 | 112 | ? __( 'Console is empty', 'site-reviews' ) |
| 113 | 113 | : $this->log; |
| 114 | 114 | } |
@@ -120,11 +120,11 @@ discard block |
||
| 120 | 120 | public function humanSize( $valueIfEmpty = null ) |
| 121 | 121 | { |
| 122 | 122 | $bytes = $this->size(); |
| 123 | - if( empty( $bytes ) && is_string( $valueIfEmpty )) { |
|
| 123 | + if( empty($bytes) && is_string( $valueIfEmpty ) ) { |
|
| 124 | 124 | return $valueIfEmpty; |
| 125 | 125 | } |
| 126 | - $exponent = floor( log( max( $bytes, 1 ), 1024 )); |
|
| 127 | - return round( $bytes / pow( 1024, $exponent ), 2 ).' '.['bytes','KB','MB','GB'][$exponent]; |
|
| 126 | + $exponent = floor( log( max( $bytes, 1 ), 1024 ) ); |
|
| 127 | + return round( $bytes / pow( 1024, $exponent ), 2 ).' '.['bytes', 'KB', 'MB', 'GB'][$exponent]; |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | /** |
@@ -148,9 +148,9 @@ discard block |
||
| 148 | 148 | { |
| 149 | 149 | $constants = (new ReflectionClass( __CLASS__ ))->getConstants(); |
| 150 | 150 | $constants = (array)apply_filters( 'site-reviews/log-levels', $constants ); |
| 151 | - if( in_array( $level, $constants, true )) { |
|
| 151 | + if( in_array( $level, $constants, true ) ) { |
|
| 152 | 152 | $entry = $this->buildLogEntry( $level, $message, $context ); |
| 153 | - file_put_contents( $this->file, $entry, FILE_APPEND|LOCK_EX ); |
|
| 153 | + file_put_contents( $this->file, $entry, FILE_APPEND | LOCK_EX ); |
|
| 154 | 154 | $this->reset(); |
| 155 | 155 | } |
| 156 | 156 | return $this; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | */ |
| 224 | 224 | protected function interpolate( $message, $context = [] ) |
| 225 | 225 | { |
| 226 | - if( $this->isObjectOrArray( $message ) || !is_array( $context )) { |
|
| 226 | + if( $this->isObjectOrArray( $message ) || !is_array( $context ) ) { |
|
| 227 | 227 | return print_r( $message, true ); |
| 228 | 228 | } |
| 229 | 229 | $replace = []; |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | if( $value instanceof DateTime ) { |
| 252 | 252 | $value = $value->format( 'Y-m-d H:i:s' ); |
| 253 | 253 | } |
| 254 | - else if( $this->isObjectOrArray( $value )) { |
|
| 254 | + else if( $this->isObjectOrArray( $value ) ) { |
|
| 255 | 255 | $value = json_encode( $value ); |
| 256 | 256 | } |
| 257 | 257 | return (string)$value; |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | $this->clear(); |
| 267 | 267 | file_put_contents( |
| 268 | 268 | $this->file, |
| 269 | - $this->buildLogEntry( 'info', __( 'Console was automatically cleared (128 KB maximum size)', 'site-reviews' )) |
|
| 269 | + $this->buildLogEntry( 'info', __( 'Console was automatically cleared (128 KB maximum size)', 'site-reviews' ) ) |
|
| 270 | 270 | ); |
| 271 | 271 | } |
| 272 | 272 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | */ |
| 23 | 23 | public function routerChangeStatus( array $request ) |
| 24 | 24 | { |
| 25 | - wp_send_json_success( $this->execute( new ChangeStatus( $request ))); |
|
| 25 | + wp_send_json_success( $this->execute( new ChangeStatus( $request ) ) ); |
|
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
@@ -31,10 +31,10 @@ discard block |
||
| 31 | 31 | public function routerClearConsole() |
| 32 | 32 | { |
| 33 | 33 | glsr( AdminController::class )->routerClearConsole(); |
| 34 | - wp_send_json_success([ |
|
| 34 | + wp_send_json_success( [ |
|
| 35 | 35 | 'console' => glsr( Console::class )->get(), |
| 36 | 36 | 'notices' => glsr( Notice::class )->get(), |
| 37 | - ]); |
|
| 37 | + ] ); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | /** |
@@ -43,9 +43,9 @@ discard block |
||
| 43 | 43 | public function routerCountReviews() |
| 44 | 44 | { |
| 45 | 45 | glsr( AdminController::class )->routerCountReviews(); |
| 46 | - wp_send_json_success([ |
|
| 46 | + wp_send_json_success( [ |
|
| 47 | 47 | 'notices' => glsr( Notice::class )->get(), |
| 48 | - ]); |
|
| 48 | + ] ); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -55,9 +55,9 @@ discard block |
||
| 55 | 55 | { |
| 56 | 56 | $shortcode = $request['shortcode']; |
| 57 | 57 | $response = false; |
| 58 | - if( array_key_exists( $shortcode, glsr()->mceShortcodes )) { |
|
| 58 | + if( array_key_exists( $shortcode, glsr()->mceShortcodes ) ) { |
|
| 59 | 59 | $data = glsr()->mceShortcodes[$shortcode]; |
| 60 | - if( !empty( $data['errors'] )) { |
|
| 60 | + if( !empty($data['errors']) ) { |
|
| 61 | 61 | $data['btn_okay'] = [esc_html__( 'Okay', 'site-reviews' )]; |
| 62 | 62 | } |
| 63 | 63 | $response = [ |
@@ -77,10 +77,10 @@ discard block |
||
| 77 | 77 | public function routerSearchPosts( array $request ) |
| 78 | 78 | { |
| 79 | 79 | $results = glsr( Database::class )->searchPosts( $request['search'] ); |
| 80 | - wp_send_json_success([ |
|
| 80 | + wp_send_json_success( [ |
|
| 81 | 81 | 'empty' => '<div>'.__( 'Nothing found.', 'site-reviews' ).'</div>', |
| 82 | 82 | 'items' => $results, |
| 83 | - ]); |
|
| 83 | + ] ); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function routerSearchTranslations( array $request ) |
| 90 | 90 | { |
| 91 | - if( empty( $request['exclude'] )) { |
|
| 91 | + if( empty($request['exclude']) ) { |
|
| 92 | 92 | $request['exclude'] = []; |
| 93 | 93 | } |
| 94 | 94 | $results = glsr( Translator::class ) |
@@ -96,10 +96,10 @@ discard block |
||
| 96 | 96 | ->exclude() |
| 97 | 97 | ->exclude( $request['exclude'] ) |
| 98 | 98 | ->renderResults(); |
| 99 | - wp_send_json_success([ |
|
| 99 | + wp_send_json_success( [ |
|
| 100 | 100 | 'empty' => '<div>'.__( 'Nothing found.', 'site-reviews' ).'</div>', |
| 101 | 101 | 'items' => $results, |
| 102 | - ]); |
|
| 102 | + ] ); |
|
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | /** |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | 'message' => glsr( Session::class )->get( $request['form_id'].'message', '', true ), |
| 114 | 114 | 'recaptcha' => glsr( Session::class )->get( $request['form_id'].'recaptcha', false, true ), |
| 115 | 115 | ]; |
| 116 | - if( !wp_validate_boolean( $data['errors'] )) { |
|
| 116 | + if( !wp_validate_boolean( $data['errors'] ) ) { |
|
| 117 | 117 | glsr( Session::class )->clear(); |
| 118 | 118 | wp_send_json_success( $data ); |
| 119 | 119 | } |
@@ -125,10 +125,10 @@ discard block |
||
| 125 | 125 | */ |
| 126 | 126 | public function routerTogglePinned( array $request ) |
| 127 | 127 | { |
| 128 | - $isPinned = $this->execute( new TogglePinned( $request )); |
|
| 129 | - wp_send_json_success([ |
|
| 128 | + $isPinned = $this->execute( new TogglePinned( $request ) ); |
|
| 129 | + wp_send_json_success( [ |
|
| 130 | 130 | 'notices' => glsr( Notice::class )->get(), |
| 131 | 131 | 'pinned' => $isPinned, |
| 132 | - ]); |
|
| 132 | + ] ); |
|
| 133 | 133 | } |
| 134 | 134 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public function callbackRegisterSettings( $input ) |
| 18 | 18 | { |
| 19 | - if( !is_array( $input )) { |
|
| 19 | + if( !is_array( $input ) ) { |
|
| 20 | 20 | $input = ['settings' => []]; |
| 21 | 21 | } |
| 22 | 22 | if( key( $input ) == 'settings' ) { |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | $options = $this->sanitizeGeneral( $input, $options ); |
| 25 | 25 | $options = $this->sanitizeSubmissions( $input, $options ); |
| 26 | 26 | $options = $this->sanitizeTranslations( $input, $options ); |
| 27 | - glsr( Notice::class )->addSuccess( __( 'Settings updated.', 'site-reviews' )); |
|
| 27 | + glsr( Notice::class )->addSuccess( __( 'Settings updated.', 'site-reviews' ) ); |
|
| 28 | 28 | return $options; |
| 29 | 29 | } |
| 30 | 30 | return $input; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | { |
| 39 | 39 | register_setting( Application::ID.'-settings', OptionManager::databaseKey(), [ |
| 40 | 40 | 'sanitize_callback' => [$this, 'callbackRegisterSettings'], |
| 41 | - ]); |
|
| 41 | + ] ); |
|
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | /** |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | protected function sanitizeSubmissions( array $input, array $options ) |
| 59 | 59 | { |
| 60 | 60 | $inputForm = $input['settings']['submissions']; |
| 61 | - $options['settings']['submissions']['required'] = isset( $inputForm['required'] ) |
|
| 61 | + $options['settings']['submissions']['required'] = isset($inputForm['required']) |
|
| 62 | 62 | ? $inputForm['required'] |
| 63 | 63 | : []; |
| 64 | 64 | return $options; |
@@ -69,13 +69,13 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | protected function sanitizeTranslations( array $input, array $options ) |
| 71 | 71 | { |
| 72 | - if( isset( $input['settings']['strings'] )) { |
|
| 73 | - $options['settings']['strings'] = array_values( array_filter( $input['settings']['strings'] )); |
|
| 72 | + if( isset($input['settings']['strings']) ) { |
|
| 73 | + $options['settings']['strings'] = array_values( array_filter( $input['settings']['strings'] ) ); |
|
| 74 | 74 | array_walk( $options['settings']['strings'], function( &$string ) { |
| 75 | - if( isset( $string['s2'] )) { |
|
| 75 | + if( isset($string['s2']) ) { |
|
| 76 | 76 | $string['s2'] = wp_strip_all_tags( $string['s2'] ); |
| 77 | 77 | } |
| 78 | - if( isset( $string['p2'] )) { |
|
| 78 | + if( isset($string['p2']) ) { |
|
| 79 | 79 | $string['p2'] = wp_strip_all_tags( $string['p2'] ); |
| 80 | 80 | } |
| 81 | 81 | }); |