@@ -63,7 +63,9 @@ |
||
| 63 | 63 | { |
| 64 | 64 | $data = wp_parse_args( $data, array_fill_keys( ['context', 'globals'], [] )); |
| 65 | 65 | foreach( $data as $key => $value ) { |
| 66 | - if( is_array( $value ))continue; |
|
| 66 | + if( is_array( $value )) { |
|
| 67 | + continue; |
|
| 68 | + } |
|
| 67 | 69 | $data[$key] = []; |
| 68 | 70 | } |
| 69 | 71 | $data['template'] = $this; |
@@ -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( '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( '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( '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( '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( '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 ), |