@@ -13,7 +13,7 @@ |
||
13 | 13 | { |
14 | 14 | $defaults = wp_parse_args( $this->defaults(), [ |
15 | 15 | 'name' => $this->builder->args['text'], |
16 | - ]); |
|
16 | + ] ); |
|
17 | 17 | $this->builder->args = wp_parse_args( $this->builder->args, $defaults ); |
18 | 18 | $this->builder->tag = 'input'; |
19 | 19 | return $this->builder->getOpeningTag(); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | 'name' => 'tripadvisor', |
13 | 13 | 'title' => 'Tripadvisor Reviews', |
14 | 14 | ], |
15 | - ]); |
|
15 | + ] ); |
|
16 | 16 | $template->render( 'partials/addons/addon', [ |
17 | 17 | 'context' => [ |
18 | 18 | 'description' => __( 'Sync your Yelp reviews and display them on your site.', 'site-reviews' ), |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | 'name' => 'yelp', |
21 | 21 | 'title' => 'Yelp Reviews', |
22 | 22 | ], |
23 | - ]); |
|
23 | + ] ); |
|
24 | 24 | ?> |
25 | 25 | </div> |
26 | 26 | </div> |
@@ -3,7 +3,7 @@ |
||
3 | 3 | <p>{{ data.s1 }}</p> |
4 | 4 | <p>{{ data.p1 }}</p> |
5 | 5 | <p class="row-actions"> |
6 | - <span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' );?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span> |
|
6 | + <span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' ); ?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span> |
|
7 | 7 | </p> |
8 | 8 | <button type="button" class="toggle-row"> |
9 | 9 | <span class="screen-reader-text"><?= __( 'Show custom translation', 'site-reviews' ); ?></span> |
@@ -2,7 +2,7 @@ |
||
2 | 2 | <td class="glsr-string-td1 column-primary"> |
3 | 3 | <p>{{ data.s1 }}</p> |
4 | 4 | <p class="row-actions"> |
5 | - <span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' );?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span> |
|
5 | + <span class="delete"><a href="#{{ data.index }}" class="delete" aria-label="<?= __( 'Delete translation string', 'site-reviews' ); ?>"><?= __( 'Delete', 'site-reviews' ); ?></a></span> |
|
6 | 6 | </p> |
7 | 7 | <button type="button" class="toggle-row"> |
8 | 8 | <span class="screen-reader-text"><?= __( 'Show custom translation', 'site-reviews' ); ?></span> |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | </ul> |
21 | 21 | </div> |
22 | 22 | |
23 | - <?php if( current_user_can( $taxonomy->cap->edit_terms )) : ?> |
|
23 | + <?php if( current_user_can( $taxonomy->cap->edit_terms ) ) : ?> |
|
24 | 24 | <div id="<?= $tax_name; ?>-adder" class="wp-hidden-children"> |
25 | 25 | <a id="<?= $tax_name; ?>-add-toggle" href="#<?= $tax_name; ?>-add" class="hide-if-no-js taxonomy-add-new"> |
26 | 26 | <?= sprintf( '+ %s', $taxonomy->labels->add_new_item ); ?> |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | <label class="screen-reader-text" for="new<?= $tax_name; ?>"><?= $taxonomy->labels->add_new_item; ?></label> |
30 | 30 | <input type="text" name="new<?= $tax_name; ?>" id="new<?= $tax_name; ?>" class="form-required form-input-tip" value="<?= esc_attr( $taxonomy->labels->new_item_name ); ?>" aria-required="true"/> |
31 | 31 | <input type="button" id="<?= $tax_name; ?>-add-submit" data-wp-lists="add:<?= $tax_name; ?>checklist:<?= $tax_name; ?>-add" class="button category-add-submit" value="<?= esc_attr( $taxonomy->labels->add_new_item ); ?>" /> |
32 | - <?php wp_nonce_field( 'add-' . $tax_name, '_ajax_nonce-add-' . $tax_name, false ); ?> |
|
32 | + <?php wp_nonce_field( 'add-'.$tax_name, '_ajax_nonce-add-'.$tax_name, false ); ?> |
|
33 | 33 | <span id="<?= $tax_name; ?>-ajax-response"></span> |
34 | 34 | </div> |
35 | 35 | </div> |
@@ -4,6 +4,6 @@ |
||
4 | 4 | <html> |
5 | 5 | <head> |
6 | 6 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
7 | - <title><?= wp_specialchars_decode( (string) get_option( 'blogname', '' ), ENT_QUOTES ); ?></title> |
|
7 | + <title><?= wp_specialchars_decode( (string)get_option( 'blogname', '' ), ENT_QUOTES ); ?></title> |
|
8 | 8 | </head> |
9 | 9 | <body> |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php defined( 'WPINC' ) || die; |
2 | 2 | |
3 | -include trailingslashit(__DIR__).'header.php'; |
|
4 | -include trailingslashit(__DIR__).'body.php'; |
|
5 | -include trailingslashit(__DIR__).'footer.php'; |
|
3 | +include trailingslashit( __DIR__ ).'header.php'; |
|
4 | +include trailingslashit( __DIR__ ).'body.php'; |
|
5 | +include trailingslashit( __DIR__ ).'footer.php'; |
@@ -109,7 +109,9 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function renderReviewEditor( WP_Post $post ) |
111 | 111 | { |
112 | - if( !$this->isReviewEditable( $post ) )return; |
|
112 | + if( !$this->isReviewEditable( $post ) ) { |
|
113 | + return; |
|
114 | + } |
|
113 | 115 | glsr()->render( 'partials/editor/review', [ |
114 | 116 | 'post' => $post, |
115 | 117 | ]); |
@@ -121,7 +123,9 @@ discard block |
||
121 | 123 | */ |
122 | 124 | public function renderReviewNotice( WP_Post $post ) |
123 | 125 | { |
124 | - if( !$this->isReviewEditable( $post ) )return; |
|
126 | + if( !$this->isReviewEditable( $post ) ) { |
|
127 | + return; |
|
128 | + } |
|
125 | 129 | glsr( Notice::class )->addWarning( __( 'This review is read-only.', 'site-reviews' )); |
126 | 130 | glsr()->render( 'partials/editor/notice' ); |
127 | 131 | } |
@@ -132,13 +136,19 @@ discard block |
||
132 | 136 | */ |
133 | 137 | public function renderTinymceButton() |
134 | 138 | { |
135 | - if( glsr_current_screen()->base != 'post' )return; |
|
139 | + if( glsr_current_screen()->base != 'post' ) { |
|
140 | + return; |
|
141 | + } |
|
136 | 142 | $shortcodes = []; |
137 | 143 | foreach( glsr()->mceShortcodes as $shortcode => $values ) { |
138 | - if( !apply_filters( sanitize_title( $shortcode ).'_condition', true ))continue; |
|
144 | + if( !apply_filters( sanitize_title( $shortcode ).'_condition', true )) { |
|
145 | + continue; |
|
146 | + } |
|
139 | 147 | $shortcodes[$shortcode] = $values; |
140 | 148 | } |
141 | - if( empty( $shortcodes ))return; |
|
149 | + if( empty( $shortcodes )) { |
|
150 | + return; |
|
151 | + } |
|
142 | 152 | glsr()->render( 'partials/editor/tinymce', [ |
143 | 153 | 'shortcodes' => $shortcodes, |
144 | 154 | ]); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | { |
35 | 35 | $links[] = glsr( Builder::class )->a( __( 'Settings', 'site-reviews' ), [ |
36 | 36 | 'href' => admin_url( 'edit.php?post_type='.Application::POST_TYPE.'&page=settings' ), |
37 | - ]); |
|
37 | + ] ); |
|
38 | 38 | return $links; |
39 | 39 | } |
40 | 40 | |
@@ -46,12 +46,12 @@ discard block |
||
46 | 46 | { |
47 | 47 | $postType = Application::POST_TYPE; |
48 | 48 | $postCount = wp_count_posts( $postType ); |
49 | - if( !isset( $postCount->publish ) || !$postCount->publish ) { |
|
49 | + if( !isset($postCount->publish) || !$postCount->publish ) { |
|
50 | 50 | return $items; |
51 | 51 | } |
52 | 52 | $postTypeObject = get_post_type_object( $postType ); |
53 | 53 | $text = _n( '%s Review', '%s Reviews', $postCount->publish, 'site-reviews' ); |
54 | - $text = sprintf( $text, number_format_i18n( $postCount->publish )); |
|
54 | + $text = sprintf( $text, number_format_i18n( $postCount->publish ) ); |
|
55 | 55 | $items[] = $postTypeObject && current_user_can( $postTypeObject->cap->edit_posts ) |
56 | 56 | ? sprintf( '<a class="glsr-review-count" href="edit.php?post_type=%s">%s</a>', $postType, $text ) |
57 | 57 | : sprintf( '<span class="glsr-review-count">%s</span>', $text ); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | public function filterTinymcePlugins( array $plugins ) |
66 | 66 | { |
67 | 67 | if( user_can_richedit() |
68 | - && ( current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' ))) { |
|
68 | + && (current_user_can( 'edit_posts' ) || current_user_can( 'edit_pages' )) ) { |
|
69 | 69 | $plugins['glsr_shortcode'] = glsr()->url( 'assets/scripts/mce-plugin.js' ); |
70 | 70 | } |
71 | 71 | return $plugins; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function registerPointers() |
79 | 79 | { |
80 | - $command = new RegisterPointers([[ |
|
80 | + $command = new RegisterPointers( [[ |
|
81 | 81 | 'content' => __( 'You can pin exceptional reviews so that they are always shown first.', 'site-reviews' ), |
82 | 82 | 'id' => 'glsr-pointer-pinned', |
83 | 83 | 'position' => [ |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | 'screen' => Application::POST_TYPE, |
88 | 88 | 'target' => '#misc-pub-pinned', |
89 | 89 | 'title' => __( 'Pin Your Reviews', 'site-reviews' ), |
90 | - ]]); |
|
90 | + ]] ); |
|
91 | 91 | $this->execute( $command ); |
92 | 92 | } |
93 | 93 | |
@@ -97,11 +97,11 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function registerShortcodeButtons() |
99 | 99 | { |
100 | - $command = new RegisterShortcodeButtons([ |
|
100 | + $command = new RegisterShortcodeButtons( [ |
|
101 | 101 | 'site_reviews' => esc_html__( 'Recent Reviews', 'site-reviews' ), |
102 | 102 | 'site_reviews_form' => esc_html__( 'Submit a Review', 'site-reviews' ), |
103 | 103 | 'site_reviews_summary' => esc_html__( 'Summary of Reviews', 'site-reviews' ), |
104 | - ]); |
|
104 | + ] ); |
|
105 | 105 | $this->execute( $command ); |
106 | 106 | } |
107 | 107 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | if( !$this->isReviewEditable( $post ) )return; |
115 | 115 | glsr()->render( 'partials/editor/review', [ |
116 | 116 | 'post' => $post, |
117 | - ]); |
|
117 | + ] ); |
|
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | public function renderReviewNotice( WP_Post $post ) |
125 | 125 | { |
126 | 126 | if( !$this->isReviewEditable( $post ) )return; |
127 | - glsr( Notice::class )->addWarning( __( 'This review is read-only.', 'site-reviews' )); |
|
127 | + glsr( Notice::class )->addWarning( __( 'This review is read-only.', 'site-reviews' ) ); |
|
128 | 128 | glsr()->render( 'partials/editor/notice' ); |
129 | 129 | } |
130 | 130 | |
@@ -137,13 +137,13 @@ discard block |
||
137 | 137 | if( glsr_current_screen()->base != 'post' )return; |
138 | 138 | $shortcodes = []; |
139 | 139 | foreach( glsr()->mceShortcodes as $shortcode => $values ) { |
140 | - if( !apply_filters( sanitize_title( $shortcode ).'_condition', true ))continue; |
|
140 | + if( !apply_filters( sanitize_title( $shortcode ).'_condition', true ) )continue; |
|
141 | 141 | $shortcodes[$shortcode] = $values; |
142 | 142 | } |
143 | - if( empty( $shortcodes ))return; |
|
143 | + if( empty($shortcodes) )return; |
|
144 | 144 | glsr()->render( 'partials/editor/tinymce', [ |
145 | 145 | 'shortcodes' => $shortcodes, |
146 | - ]); |
|
146 | + ] ); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | public function routerClearLog() |
153 | 153 | { |
154 | 154 | glsr( Logger::class )->clear(); |
155 | - glsr( Notice::class )->addSuccess( __( 'Log cleared.', 'site-reviews' )); |
|
155 | + glsr( Notice::class )->addSuccess( __( 'Log cleared.', 'site-reviews' ) ); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
@@ -186,17 +186,17 @@ discard block |
||
186 | 186 | { |
187 | 187 | $file = $_FILES['import-file']; |
188 | 188 | if( $file['error'] !== UPLOAD_ERR_OK ) { |
189 | - return glsr( Notice::class )->addError( $this->getUploadError( $file['error'] )); |
|
189 | + return glsr( Notice::class )->addError( $this->getUploadError( $file['error'] ) ); |
|
190 | 190 | } |
191 | - if( $file['type'] !== 'application/json' || !glsr( Helper::class )->endsWith( '.json', $file['name'] )) { |
|
192 | - return glsr( Notice::class )->addError( __( 'Please use a valid Site Reviews settings file.', 'site-reviews' )); |
|
191 | + if( $file['type'] !== 'application/json' || !glsr( Helper::class )->endsWith( '.json', $file['name'] ) ) { |
|
192 | + return glsr( Notice::class )->addError( __( 'Please use a valid Site Reviews settings file.', 'site-reviews' ) ); |
|
193 | 193 | } |
194 | 194 | $settings = json_decode( file_get_contents( $file['tmp_name'] ), true ); |
195 | - if( empty( $settings )) { |
|
196 | - return glsr( Notice::class )->addWarning( __( 'There were no settings found to import.', 'site-reviews' )); |
|
195 | + if( empty($settings) ) { |
|
196 | + return glsr( Notice::class )->addWarning( __( 'There were no settings found to import.', 'site-reviews' ) ); |
|
197 | 197 | } |
198 | - glsr( OptionManager::class )->set( glsr( OptionManager::class )->normalize( $settings )); |
|
199 | - glsr( Notice::class )->addSuccess( __( 'Settings imported.', 'site-reviews' )); |
|
198 | + glsr( OptionManager::class )->set( glsr( OptionManager::class )->normalize( $settings ) ); |
|
199 | + glsr( Notice::class )->addSuccess( __( 'Settings imported.', 'site-reviews' ) ); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | /** |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | UPLOAD_ERR_CANT_WRITE => __( 'Failed to write file to disk.', 'site-reviews' ), |
215 | 215 | UPLOAD_ERR_EXTENSION => __( 'A PHP extension stopped the file upload.', 'site-reviews' ), |
216 | 216 | ]; |
217 | - return !isset( $errors[$errorCode] ) |
|
217 | + return !isset($errors[$errorCode]) |
|
218 | 218 | ? __( 'Unknown upload error.', 'site-reviews' ) |
219 | 219 | : $errors[$errorCode]; |
220 | 220 | } |
@@ -147,13 +147,13 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function renderAssignedToMetabox( WP_Post $post ) |
149 | 149 | { |
150 | - if( !$this->isReviewPostType( $post ))return; |
|
151 | - $assignedTo = intval( get_post_meta( $post->ID, 'assigned_to', true )); |
|
150 | + if( !$this->isReviewPostType( $post ) )return; |
|
151 | + $assignedTo = intval( get_post_meta( $post->ID, 'assigned_to', true ) ); |
|
152 | 152 | wp_nonce_field( 'assigned_to', '_nonce-assigned-to', false ); |
153 | 153 | glsr()->render( 'partials/editor/metabox-assigned-to', [ |
154 | 154 | 'id' => $assignedTo, |
155 | 155 | 'template' => $this->buildAssignedToTemplate( $assignedTo ), |
156 | - ]); |
|
156 | + ] ); |
|
157 | 157 | } |
158 | 158 | |
159 | 159 | /** |
@@ -162,12 +162,12 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function renderDetailsMetaBox( WP_Post $post ) |
164 | 164 | { |
165 | - if( !$this->isReviewPostType( $post ))return; |
|
165 | + if( !$this->isReviewPostType( $post ) )return; |
|
166 | 166 | $review = glsr( Database::class )->getReview( $post ); |
167 | 167 | glsr()->render( 'partials/editor/metabox-details', [ |
168 | 168 | 'button' => $this->buildDetailsMetaBoxRevertButton( $review, $post ), |
169 | 169 | 'metabox' => $this->normalizeDetailsMetaBox( $review ), |
170 | - ]); |
|
170 | + ] ); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -176,10 +176,10 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function renderPinnedInPublishMetaBox() |
178 | 178 | { |
179 | - if( !$this->isReviewPostType( get_post() ))return; |
|
179 | + if( !$this->isReviewPostType( get_post() ) )return; |
|
180 | 180 | glsr()->render( 'partials/editor/pinned', [ |
181 | - 'pinned' => boolval( get_post_meta( intval( get_the_ID() ), 'pinned', true )), |
|
182 | - ]); |
|
181 | + 'pinned' => boolval( get_post_meta( intval( get_the_ID() ), 'pinned', true ) ), |
|
182 | + ] ); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
@@ -188,11 +188,11 @@ discard block |
||
188 | 188 | */ |
189 | 189 | public function renderResponseMetaBox( WP_Post $post ) |
190 | 190 | { |
191 | - if( !$this->isReviewPostType( $post ))return; |
|
191 | + if( !$this->isReviewPostType( $post ) )return; |
|
192 | 192 | wp_nonce_field( 'response', '_nonce-response', false ); |
193 | 193 | glsr()->render( 'partials/editor/metabox-response', [ |
194 | 194 | 'response' => glsr( Database::class )->getReview( $post )->response, |
195 | - ]); |
|
195 | + ] ); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
@@ -202,12 +202,12 @@ discard block |
||
202 | 202 | */ |
203 | 203 | public function renderTaxonomyMetabox( WP_Post $post ) |
204 | 204 | { |
205 | - if( !$this->isReviewPostType( $post ))return; |
|
205 | + if( !$this->isReviewPostType( $post ) )return; |
|
206 | 206 | glsr()->render( 'partials/editor/metabox-categories', [ |
207 | 207 | 'post' => $post, |
208 | 208 | 'tax_name' => Application::TAXONOMY, |
209 | 209 | 'taxonomy' => get_taxonomy( Application::TAXONOMY ), |
210 | - ]); |
|
210 | + ] ); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | */ |
218 | 218 | public function revertReview() |
219 | 219 | { |
220 | - check_admin_referer( 'revert-review_'.( $postId = $this->getPostId() )); |
|
220 | + check_admin_referer( 'revert-review_'.($postId = $this->getPostId()) ); |
|
221 | 221 | glsr( Database::class )->revertReview( $postId ); |
222 | 222 | $this->redirect( $postId, 52 ); |
223 | 223 | } |
@@ -240,13 +240,13 @@ discard block |
||
240 | 240 | protected function buildAssignedToTemplate( $assignedTo ) |
241 | 241 | { |
242 | 242 | $assignedPost = get_post( $assignedTo ); |
243 | - if( !( $assignedPost instanceof WP_Post ))return; |
|
243 | + if( !($assignedPost instanceof WP_Post) )return; |
|
244 | 244 | return glsr( Html::class )->buildTemplate( 'edit/assigned-post', [ |
245 | 245 | 'context' => [ |
246 | 246 | 'url' => (string)get_permalink( $assignedPost ), |
247 | 247 | 'title' => get_the_title( $assignedPost ), |
248 | 248 | ], |
249 | - ]); |
|
249 | + ] ); |
|
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
@@ -267,13 +267,13 @@ discard block |
||
267 | 267 | 'class' => 'button button-large', |
268 | 268 | 'href' => $revertUrl, |
269 | 269 | 'id' => 'revert', |
270 | - ]); |
|
270 | + ] ); |
|
271 | 271 | } |
272 | 272 | return glsr( Builder::class )->button( __( 'Nothing to Revert', 'site-reviews' ), [ |
273 | 273 | 'class' => 'button button-large', |
274 | 274 | 'disabled' => true, |
275 | 275 | 'id' => 'revert', |
276 | - ]); |
|
276 | + ] ); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | /** |
@@ -283,11 +283,11 @@ discard block |
||
283 | 283 | protected function getReviewType( $review ) |
284 | 284 | { |
285 | 285 | $reviewType = $review->review_type; |
286 | - if( !empty( $review->url )) { |
|
286 | + if( !empty($review->url) ) { |
|
287 | 287 | $reviewType = glsr( Builder::class )->a( $reviewType, [ |
288 | 288 | 'href' => $review->url, |
289 | 289 | 'target' => '_blank', |
290 | - ]); |
|
290 | + ] ); |
|
291 | 291 | } |
292 | 292 | return in_array( $reviewType, glsr()->reviewTypes ) |
293 | 293 | ? glsr()->reviewTypes[$reviewType] |
@@ -309,16 +309,16 @@ discard block |
||
309 | 309 | */ |
310 | 310 | protected function normalizeDetailsMetaBox( $review ) |
311 | 311 | { |
312 | - $reviewer = empty( $review->user_id ) |
|
312 | + $reviewer = empty($review->user_id) |
|
313 | 313 | ? __( 'Unregistered user', 'site-reviews' ) |
314 | 314 | : glsr( Builder::class )->a( get_the_author_meta( 'display_name', $review->user_id ), [ |
315 | 315 | 'href' => get_author_posts_url( $review->user_id ), |
316 | - ]); |
|
317 | - $email = empty( $review->email ) |
|
316 | + ] ); |
|
317 | + $email = empty($review->email) |
|
318 | 318 | ? '—' |
319 | 319 | : glsr( Builder::class )->a( $review->email, [ |
320 | 320 | 'href' => 'mailto:'.$review->email.'?subject='.esc_attr( __( 'RE:', 'site-reviews' ).' '.$review->title ), |
321 | - ]); |
|
321 | + ] ); |
|
322 | 322 | $metabox = [ |
323 | 323 | __( 'Rating', 'site-reviews' ) => glsr( Html::class )->renderPartial( 'star-rating', ['rating' => $review->rating] ), |
324 | 324 | __( 'Type', 'site-reviews' ) => $this->getReviewType( $review ), |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | $redirectUri = $hasReferer |
347 | 347 | ? remove_query_arg( ['deleted', 'ids', 'trashed', 'untrashed'], $referer ) |
348 | 348 | : get_edit_post_link( $postId ); |
349 | - wp_safe_redirect( add_query_arg( ['message' => $messageIndex], $redirectUri )); |
|
349 | + wp_safe_redirect( add_query_arg( ['message' => $messageIndex], $redirectUri ) ); |
|
350 | 350 | exit; |
351 | 351 | } |
352 | 352 | } |
@@ -117,7 +117,9 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function registerMetaBoxes( $postType ) |
119 | 119 | { |
120 | - if( $postType != Application::POST_TYPE )return; |
|
120 | + if( $postType != Application::POST_TYPE ) { |
|
121 | + return; |
|
122 | + } |
|
121 | 123 | add_meta_box( Application::ID.'_assigned_to', __( 'Assigned To', 'site-reviews' ), [$this, 'renderAssignedToMetabox'], null, 'side' ); |
122 | 124 | add_meta_box( Application::ID.'_review', __( 'Details', 'site-reviews' ), [$this, 'renderDetailsMetaBox'], null, 'side' ); |
123 | 125 | add_meta_box( Application::ID.'_response', __( 'Respond Publicly', 'site-reviews' ), [$this, 'renderResponseMetaBox'], null, 'normal' ); |
@@ -147,7 +149,9 @@ discard block |
||
147 | 149 | */ |
148 | 150 | public function renderAssignedToMetabox( WP_Post $post ) |
149 | 151 | { |
150 | - if( !$this->isReviewPostType( $post ))return; |
|
152 | + if( !$this->isReviewPostType( $post )) { |
|
153 | + return; |
|
154 | + } |
|
151 | 155 | $assignedTo = intval( get_post_meta( $post->ID, 'assigned_to', true )); |
152 | 156 | wp_nonce_field( 'assigned_to', '_nonce-assigned-to', false ); |
153 | 157 | glsr()->render( 'partials/editor/metabox-assigned-to', [ |
@@ -162,7 +166,9 @@ discard block |
||
162 | 166 | */ |
163 | 167 | public function renderDetailsMetaBox( WP_Post $post ) |
164 | 168 | { |
165 | - if( !$this->isReviewPostType( $post ))return; |
|
169 | + if( !$this->isReviewPostType( $post )) { |
|
170 | + return; |
|
171 | + } |
|
166 | 172 | $review = glsr( Database::class )->getReview( $post ); |
167 | 173 | glsr()->render( 'partials/editor/metabox-details', [ |
168 | 174 | 'button' => $this->buildDetailsMetaBoxRevertButton( $review, $post ), |
@@ -176,7 +182,9 @@ discard block |
||
176 | 182 | */ |
177 | 183 | public function renderPinnedInPublishMetaBox() |
178 | 184 | { |
179 | - if( !$this->isReviewPostType( get_post() ))return; |
|
185 | + if( !$this->isReviewPostType( get_post() )) { |
|
186 | + return; |
|
187 | + } |
|
180 | 188 | glsr()->render( 'partials/editor/pinned', [ |
181 | 189 | 'pinned' => boolval( get_post_meta( intval( get_the_ID() ), 'pinned', true )), |
182 | 190 | ]); |
@@ -188,7 +196,9 @@ discard block |
||
188 | 196 | */ |
189 | 197 | public function renderResponseMetaBox( WP_Post $post ) |
190 | 198 | { |
191 | - if( !$this->isReviewPostType( $post ))return; |
|
199 | + if( !$this->isReviewPostType( $post )) { |
|
200 | + return; |
|
201 | + } |
|
192 | 202 | wp_nonce_field( 'response', '_nonce-response', false ); |
193 | 203 | glsr()->render( 'partials/editor/metabox-response', [ |
194 | 204 | 'response' => glsr( Database::class )->getReview( $post )->response, |
@@ -202,7 +212,9 @@ discard block |
||
202 | 212 | */ |
203 | 213 | public function renderTaxonomyMetabox( WP_Post $post ) |
204 | 214 | { |
205 | - if( !$this->isReviewPostType( $post ))return; |
|
215 | + if( !$this->isReviewPostType( $post )) { |
|
216 | + return; |
|
217 | + } |
|
206 | 218 | glsr()->render( 'partials/editor/metabox-categories', [ |
207 | 219 | 'post' => $post, |
208 | 220 | 'tax_name' => Application::TAXONOMY, |
@@ -240,7 +252,9 @@ discard block |
||
240 | 252 | protected function buildAssignedToTemplate( $assignedTo ) |
241 | 253 | { |
242 | 254 | $assignedPost = get_post( $assignedTo ); |
243 | - if( !( $assignedPost instanceof WP_Post ))return; |
|
255 | + if( !( $assignedPost instanceof WP_Post )) { |
|
256 | + return; |
|
257 | + } |
|
244 | 258 | return glsr( Html::class )->buildTemplate( 'edit/assigned-post', [ |
245 | 259 | 'context' => [ |
246 | 260 | 'url' => (string)get_permalink( $assignedPost ), |