@@ -17,7 +17,7 @@ |
||
17 | 17 | 'avatar' => '', |
18 | 18 | 'content' => '', |
19 | 19 | 'custom' => '', |
20 | - 'date' => get_date_from_gmt( gmdate( 'Y-m-d H:i:s' )), |
|
20 | + 'date' => get_date_from_gmt( gmdate( 'Y-m-d H:i:s' ) ), |
|
21 | 21 | 'email' => '', |
22 | 22 | 'ip_address' => '', |
23 | 23 | 'pinned' => false, |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | 'review_type' => '', |
64 | 64 | ]; |
65 | 65 | $meta = array_filter( |
66 | - array_map( 'array_shift', (array)get_post_meta( $post->ID )), |
|
66 | + array_map( 'array_shift', (array)get_post_meta( $post->ID ) ), |
|
67 | 67 | 'strlen' |
68 | 68 | ); |
69 | - $properties = glsr( CreateReviewDefaults::class )->restrict( array_merge( $defaults, $meta )); |
|
69 | + $properties = glsr( CreateReviewDefaults::class )->restrict( array_merge( $defaults, $meta ) ); |
|
70 | 70 | $this->modified = $this->isModified( $properties ); |
71 | 71 | array_walk( $properties, function( $value, $key ) { |
72 | - if( !property_exists( $this, $key ) || isset( $this->$key ))return; |
|
72 | + if( !property_exists( $this, $key ) || isset($this->$key) )return; |
|
73 | 73 | $this->$key = maybe_unserialize( $value ); |
74 | 74 | }); |
75 | 75 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | protected function setTermIds( WP_Post $post ) |
81 | 81 | { |
82 | 82 | $this->term_ids = []; |
83 | - if( !is_array( $terms = get_the_terms( $post, Application::TAXONOMY )))return; |
|
83 | + if( !is_array( $terms = get_the_terms( $post, Application::TAXONOMY ) ) )return; |
|
84 | 84 | foreach( $terms as $term ) { |
85 | 85 | $this->term_ids[] = $term->term_id; |
86 | 86 | } |
@@ -69,7 +69,9 @@ discard block |
||
69 | 69 | $properties = glsr( CreateReviewDefaults::class )->restrict( array_merge( $defaults, $meta )); |
70 | 70 | $this->modified = $this->isModified( $properties ); |
71 | 71 | array_walk( $properties, function( $value, $key ) { |
72 | - if( !property_exists( $this, $key ) || isset( $this->$key ))return; |
|
72 | + if( !property_exists( $this, $key ) || isset( $this->$key )) { |
|
73 | + return; |
|
74 | + } |
|
73 | 75 | $this->$key = maybe_unserialize( $value ); |
74 | 76 | }); |
75 | 77 | } |
@@ -80,7 +82,9 @@ discard block |
||
80 | 82 | protected function setTermIds( WP_Post $post ) |
81 | 83 | { |
82 | 84 | $this->term_ids = []; |
83 | - if( !is_array( $terms = get_the_terms( $post, Application::TAXONOMY )))return; |
|
85 | + if( !is_array( $terms = get_the_terms( $post, Application::TAXONOMY ))) { |
|
86 | + return; |
|
87 | + } |
|
84 | 88 | foreach( $terms as $term ) { |
85 | 89 | $this->term_ids[] = $term->term_id; |
86 | 90 | } |