@@ -4,10 +4,10 @@ |
||
4 | 4 | |
5 | 5 | class RegisterTaxonomy |
6 | 6 | { |
7 | - public $args; |
|
7 | + public $args; |
|
8 | 8 | |
9 | - public function __construct($input) |
|
10 | - { |
|
11 | - $this->args = $input; |
|
12 | - } |
|
9 | + public function __construct($input) |
|
10 | + { |
|
11 | + $this->args = $input; |
|
12 | + } |
|
13 | 13 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | public $args; |
8 | 8 | |
9 | - public function __construct($input) |
|
9 | + public function __construct( $input ) |
|
10 | 10 | { |
11 | 11 | $this->args = $input; |
12 | 12 | } |
@@ -4,10 +4,10 @@ |
||
4 | 4 | |
5 | 5 | class EnqueueAdminAssets |
6 | 6 | { |
7 | - public $pointers; |
|
7 | + public $pointers; |
|
8 | 8 | |
9 | - public function __construct(array $input) |
|
10 | - { |
|
11 | - $this->pointers = $input['pointers']; |
|
12 | - } |
|
9 | + public function __construct(array $input) |
|
10 | + { |
|
11 | + $this->pointers = $input['pointers']; |
|
12 | + } |
|
13 | 13 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | public $pointers; |
8 | 8 | |
9 | - public function __construct(array $input) |
|
9 | + public function __construct( array $input ) |
|
10 | 10 | { |
11 | 11 | $this->pointers = $input['pointers']; |
12 | 12 | } |
@@ -4,10 +4,10 @@ |
||
4 | 4 | |
5 | 5 | class RegisterShortcodes |
6 | 6 | { |
7 | - public $shortcodes; |
|
7 | + public $shortcodes; |
|
8 | 8 | |
9 | - public function __construct($input) |
|
10 | - { |
|
11 | - $this->shortcodes = $input; |
|
12 | - } |
|
9 | + public function __construct($input) |
|
10 | + { |
|
11 | + $this->shortcodes = $input; |
|
12 | + } |
|
13 | 13 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | public $shortcodes; |
8 | 8 | |
9 | - public function __construct($input) |
|
9 | + public function __construct( $input ) |
|
10 | 10 | { |
11 | 11 | $this->shortcodes = $input; |
12 | 12 | } |
@@ -116,7 +116,8 @@ |
||
116 | 116 | ]; |
117 | 117 | if (is_numeric($searchTerm)) { |
118 | 118 | $args['post__in'] = [$searchTerm]; |
119 | - } else { |
|
119 | + } |
|
120 | + else { |
|
120 | 121 | $args['orderby'] = 'relevance'; |
121 | 122 | $args['posts_per_page'] = 10; |
122 | 123 | $args['s'] = $searchTerm; |
@@ -12,168 +12,168 @@ |
||
12 | 12 | |
13 | 13 | class Database |
14 | 14 | { |
15 | - /** |
|
16 | - * @param int $postId |
|
17 | - * @param string $key |
|
18 | - * @param bool $single |
|
19 | - * @return mixed |
|
20 | - */ |
|
21 | - public function get($postId, $key, $single = true) |
|
22 | - { |
|
23 | - $key = Str::prefix('_', $key); |
|
24 | - return get_post_meta(intval($postId), $key, $single); |
|
25 | - } |
|
15 | + /** |
|
16 | + * @param int $postId |
|
17 | + * @param string $key |
|
18 | + * @param bool $single |
|
19 | + * @return mixed |
|
20 | + */ |
|
21 | + public function get($postId, $key, $single = true) |
|
22 | + { |
|
23 | + $key = Str::prefix('_', $key); |
|
24 | + return get_post_meta(intval($postId), $key, $single); |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * @param int $postId |
|
29 | - * @param string $assignedTo |
|
30 | - * @return void|WP_Post |
|
31 | - */ |
|
32 | - public function getAssignedToPost($postId, $assignedTo = '') |
|
33 | - { |
|
34 | - if (empty($assignedTo)) { |
|
35 | - $assignedTo = $this->get($postId, 'assigned_to'); |
|
36 | - } |
|
37 | - if (empty($assignedTo)) { |
|
38 | - return; |
|
39 | - } |
|
40 | - $assignedPost = get_post($assignedTo); |
|
41 | - if ($assignedPost instanceof WP_Post && $assignedPost->ID != $postId) { |
|
42 | - return $assignedPost; |
|
43 | - } |
|
44 | - } |
|
27 | + /** |
|
28 | + * @param int $postId |
|
29 | + * @param string $assignedTo |
|
30 | + * @return void|WP_Post |
|
31 | + */ |
|
32 | + public function getAssignedToPost($postId, $assignedTo = '') |
|
33 | + { |
|
34 | + if (empty($assignedTo)) { |
|
35 | + $assignedTo = $this->get($postId, 'assigned_to'); |
|
36 | + } |
|
37 | + if (empty($assignedTo)) { |
|
38 | + return; |
|
39 | + } |
|
40 | + $assignedPost = get_post($assignedTo); |
|
41 | + if ($assignedPost instanceof WP_Post && $assignedPost->ID != $postId) { |
|
42 | + return $assignedPost; |
|
43 | + } |
|
44 | + } |
|
45 | 45 | |
46 | - /** |
|
47 | - * @param string $metaKey |
|
48 | - * @param string $metaValue |
|
49 | - * @return array|int |
|
50 | - */ |
|
51 | - public function getReviewCount($metaKey = '', $metaValue = '') |
|
52 | - { |
|
53 | - if (!$metaKey) { |
|
54 | - return (array) wp_count_posts(Application::POST_TYPE); |
|
55 | - } |
|
56 | - $counts = glsr(Cache::class)->getReviewCountsFor($metaKey); |
|
57 | - if (!$metaValue) { |
|
58 | - return $counts; |
|
59 | - } |
|
60 | - return Arr::get($counts, $metaValue, 0); |
|
61 | - } |
|
46 | + /** |
|
47 | + * @param string $metaKey |
|
48 | + * @param string $metaValue |
|
49 | + * @return array|int |
|
50 | + */ |
|
51 | + public function getReviewCount($metaKey = '', $metaValue = '') |
|
52 | + { |
|
53 | + if (!$metaKey) { |
|
54 | + return (array) wp_count_posts(Application::POST_TYPE); |
|
55 | + } |
|
56 | + $counts = glsr(Cache::class)->getReviewCountsFor($metaKey); |
|
57 | + if (!$metaValue) { |
|
58 | + return $counts; |
|
59 | + } |
|
60 | + return Arr::get($counts, $metaValue, 0); |
|
61 | + } |
|
62 | 62 | |
63 | - /** |
|
64 | - * @param string $metaReviewType |
|
65 | - * @return array |
|
66 | - */ |
|
67 | - public function getReviewIdsByType($metaReviewType) |
|
68 | - { |
|
69 | - return glsr(SqlQueries::class)->getReviewIdsByType($metaReviewType); |
|
70 | - } |
|
63 | + /** |
|
64 | + * @param string $metaReviewType |
|
65 | + * @return array |
|
66 | + */ |
|
67 | + public function getReviewIdsByType($metaReviewType) |
|
68 | + { |
|
69 | + return glsr(SqlQueries::class)->getReviewIdsByType($metaReviewType); |
|
70 | + } |
|
71 | 71 | |
72 | - /** |
|
73 | - * @param string $key |
|
74 | - * @param string $status |
|
75 | - * @return array |
|
76 | - */ |
|
77 | - public function getReviewsMeta($key, $status = 'publish') |
|
78 | - { |
|
79 | - return glsr(SqlQueries::class)->getReviewsMeta($key, $status); |
|
80 | - } |
|
72 | + /** |
|
73 | + * @param string $key |
|
74 | + * @param string $status |
|
75 | + * @return array |
|
76 | + */ |
|
77 | + public function getReviewsMeta($key, $status = 'publish') |
|
78 | + { |
|
79 | + return glsr(SqlQueries::class)->getReviewsMeta($key, $status); |
|
80 | + } |
|
81 | 81 | |
82 | - /** |
|
83 | - * @param string $field |
|
84 | - * @return array |
|
85 | - */ |
|
86 | - public function getTermIds(array $values, $field) |
|
87 | - { |
|
88 | - $termIds = []; |
|
89 | - foreach ($values as $value) { |
|
90 | - $term = get_term_by($field, $value, Application::TAXONOMY); |
|
91 | - if (!isset($term->term_id)) { |
|
92 | - continue; |
|
93 | - } |
|
94 | - $termIds[] = $term->term_id; |
|
95 | - } |
|
96 | - return $termIds; |
|
97 | - } |
|
82 | + /** |
|
83 | + * @param string $field |
|
84 | + * @return array |
|
85 | + */ |
|
86 | + public function getTermIds(array $values, $field) |
|
87 | + { |
|
88 | + $termIds = []; |
|
89 | + foreach ($values as $value) { |
|
90 | + $term = get_term_by($field, $value, Application::TAXONOMY); |
|
91 | + if (!isset($term->term_id)) { |
|
92 | + continue; |
|
93 | + } |
|
94 | + $termIds[] = $term->term_id; |
|
95 | + } |
|
96 | + return $termIds; |
|
97 | + } |
|
98 | 98 | |
99 | - /** |
|
100 | - * @return array |
|
101 | - */ |
|
102 | - public function getTerms(array $args = []) |
|
103 | - { |
|
104 | - $args = wp_parse_args($args, [ |
|
105 | - 'count' => false, |
|
106 | - 'fields' => 'id=>name', |
|
107 | - 'hide_empty' => false, |
|
108 | - 'taxonomy' => Application::TAXONOMY, |
|
109 | - ]); |
|
110 | - $terms = get_terms($args); |
|
111 | - if (is_wp_error($terms)) { |
|
112 | - glsr_log()->error($terms->get_error_message()); |
|
113 | - return []; |
|
114 | - } |
|
115 | - return $terms; |
|
116 | - } |
|
99 | + /** |
|
100 | + * @return array |
|
101 | + */ |
|
102 | + public function getTerms(array $args = []) |
|
103 | + { |
|
104 | + $args = wp_parse_args($args, [ |
|
105 | + 'count' => false, |
|
106 | + 'fields' => 'id=>name', |
|
107 | + 'hide_empty' => false, |
|
108 | + 'taxonomy' => Application::TAXONOMY, |
|
109 | + ]); |
|
110 | + $terms = get_terms($args); |
|
111 | + if (is_wp_error($terms)) { |
|
112 | + glsr_log()->error($terms->get_error_message()); |
|
113 | + return []; |
|
114 | + } |
|
115 | + return $terms; |
|
116 | + } |
|
117 | 117 | |
118 | - /** |
|
119 | - * @param string $searchTerm |
|
120 | - * @return void|string |
|
121 | - */ |
|
122 | - public function searchPosts($searchTerm) |
|
123 | - { |
|
124 | - $args = [ |
|
125 | - 'post_status' => 'publish', |
|
126 | - 'post_type' => 'any', |
|
127 | - ]; |
|
128 | - if (is_numeric($searchTerm)) { |
|
129 | - $args['post__in'] = [$searchTerm]; |
|
130 | - } else { |
|
131 | - $args['orderby'] = 'relevance'; |
|
132 | - $args['posts_per_page'] = 10; |
|
133 | - $args['s'] = $searchTerm; |
|
134 | - } |
|
135 | - $queryBuilder = glsr(QueryBuilder::class); |
|
136 | - add_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2); |
|
137 | - $search = new WP_Query($args); |
|
138 | - remove_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500); |
|
139 | - if (!$search->have_posts()) { |
|
140 | - return; |
|
141 | - } |
|
142 | - $results = ''; |
|
143 | - while ($search->have_posts()) { |
|
144 | - $search->the_post(); |
|
145 | - ob_start(); |
|
146 | - glsr()->render('partials/editor/search-result', [ |
|
147 | - 'ID' => get_the_ID(), |
|
148 | - 'permalink' => esc_url((string) get_permalink()), |
|
149 | - 'title' => esc_attr(get_the_title()), |
|
150 | - ]); |
|
151 | - $results.= ob_get_clean(); |
|
152 | - } |
|
153 | - wp_reset_postdata(); |
|
154 | - return $results; |
|
155 | - } |
|
118 | + /** |
|
119 | + * @param string $searchTerm |
|
120 | + * @return void|string |
|
121 | + */ |
|
122 | + public function searchPosts($searchTerm) |
|
123 | + { |
|
124 | + $args = [ |
|
125 | + 'post_status' => 'publish', |
|
126 | + 'post_type' => 'any', |
|
127 | + ]; |
|
128 | + if (is_numeric($searchTerm)) { |
|
129 | + $args['post__in'] = [$searchTerm]; |
|
130 | + } else { |
|
131 | + $args['orderby'] = 'relevance'; |
|
132 | + $args['posts_per_page'] = 10; |
|
133 | + $args['s'] = $searchTerm; |
|
134 | + } |
|
135 | + $queryBuilder = glsr(QueryBuilder::class); |
|
136 | + add_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2); |
|
137 | + $search = new WP_Query($args); |
|
138 | + remove_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500); |
|
139 | + if (!$search->have_posts()) { |
|
140 | + return; |
|
141 | + } |
|
142 | + $results = ''; |
|
143 | + while ($search->have_posts()) { |
|
144 | + $search->the_post(); |
|
145 | + ob_start(); |
|
146 | + glsr()->render('partials/editor/search-result', [ |
|
147 | + 'ID' => get_the_ID(), |
|
148 | + 'permalink' => esc_url((string) get_permalink()), |
|
149 | + 'title' => esc_attr(get_the_title()), |
|
150 | + ]); |
|
151 | + $results.= ob_get_clean(); |
|
152 | + } |
|
153 | + wp_reset_postdata(); |
|
154 | + return $results; |
|
155 | + } |
|
156 | 156 | |
157 | - /** |
|
158 | - * @param int $postId |
|
159 | - * @param string $key |
|
160 | - * @param mixed $value |
|
161 | - * @return int|bool |
|
162 | - */ |
|
163 | - public function set($postId, $key, $value) |
|
164 | - { |
|
165 | - $key = Str::prefix('_', $key); |
|
166 | - return update_post_meta($postId, $key, $value); |
|
167 | - } |
|
157 | + /** |
|
158 | + * @param int $postId |
|
159 | + * @param string $key |
|
160 | + * @param mixed $value |
|
161 | + * @return int|bool |
|
162 | + */ |
|
163 | + public function set($postId, $key, $value) |
|
164 | + { |
|
165 | + $key = Str::prefix('_', $key); |
|
166 | + return update_post_meta($postId, $key, $value); |
|
167 | + } |
|
168 | 168 | |
169 | - /** |
|
170 | - * @param int $postId |
|
171 | - * @param string $key |
|
172 | - * @param mixed $value |
|
173 | - * @return int|bool |
|
174 | - */ |
|
175 | - public function update($postId, $key, $value) |
|
176 | - { |
|
177 | - return $this->set($postId, $key, $value); |
|
178 | - } |
|
169 | + /** |
|
170 | + * @param int $postId |
|
171 | + * @param string $key |
|
172 | + * @param mixed $value |
|
173 | + * @return int|bool |
|
174 | + */ |
|
175 | + public function update($postId, $key, $value) |
|
176 | + { |
|
177 | + return $this->set($postId, $key, $value); |
|
178 | + } |
|
179 | 179 | } |
@@ -18,10 +18,10 @@ discard block |
||
18 | 18 | * @param bool $single |
19 | 19 | * @return mixed |
20 | 20 | */ |
21 | - public function get($postId, $key, $single = true) |
|
21 | + public function get( $postId, $key, $single = true ) |
|
22 | 22 | { |
23 | - $key = Str::prefix('_', $key); |
|
24 | - return get_post_meta(intval($postId), $key, $single); |
|
23 | + $key = Str::prefix( '_', $key ); |
|
24 | + return get_post_meta( intval( $postId ), $key, $single ); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | /** |
@@ -29,16 +29,16 @@ discard block |
||
29 | 29 | * @param string $assignedTo |
30 | 30 | * @return void|WP_Post |
31 | 31 | */ |
32 | - public function getAssignedToPost($postId, $assignedTo = '') |
|
32 | + public function getAssignedToPost( $postId, $assignedTo = '' ) |
|
33 | 33 | { |
34 | - if (empty($assignedTo)) { |
|
35 | - $assignedTo = $this->get($postId, 'assigned_to'); |
|
34 | + if( empty($assignedTo) ) { |
|
35 | + $assignedTo = $this->get( $postId, 'assigned_to' ); |
|
36 | 36 | } |
37 | - if (empty($assignedTo)) { |
|
37 | + if( empty($assignedTo) ) { |
|
38 | 38 | return; |
39 | 39 | } |
40 | - $assignedPost = get_post($assignedTo); |
|
41 | - if ($assignedPost instanceof WP_Post && $assignedPost->ID != $postId) { |
|
40 | + $assignedPost = get_post( $assignedTo ); |
|
41 | + if( $assignedPost instanceof WP_Post && $assignedPost->ID != $postId ) { |
|
42 | 42 | return $assignedPost; |
43 | 43 | } |
44 | 44 | } |
@@ -48,25 +48,25 @@ discard block |
||
48 | 48 | * @param string $metaValue |
49 | 49 | * @return array|int |
50 | 50 | */ |
51 | - public function getReviewCount($metaKey = '', $metaValue = '') |
|
51 | + public function getReviewCount( $metaKey = '', $metaValue = '' ) |
|
52 | 52 | { |
53 | - if (!$metaKey) { |
|
54 | - return (array) wp_count_posts(Application::POST_TYPE); |
|
53 | + if( !$metaKey ) { |
|
54 | + return (array)wp_count_posts( Application::POST_TYPE ); |
|
55 | 55 | } |
56 | - $counts = glsr(Cache::class)->getReviewCountsFor($metaKey); |
|
57 | - if (!$metaValue) { |
|
56 | + $counts = glsr( Cache::class )->getReviewCountsFor( $metaKey ); |
|
57 | + if( !$metaValue ) { |
|
58 | 58 | return $counts; |
59 | 59 | } |
60 | - return Arr::get($counts, $metaValue, 0); |
|
60 | + return Arr::get( $counts, $metaValue, 0 ); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
64 | 64 | * @param string $metaReviewType |
65 | 65 | * @return array |
66 | 66 | */ |
67 | - public function getReviewIdsByType($metaReviewType) |
|
67 | + public function getReviewIdsByType( $metaReviewType ) |
|
68 | 68 | { |
69 | - return glsr(SqlQueries::class)->getReviewIdsByType($metaReviewType); |
|
69 | + return glsr( SqlQueries::class )->getReviewIdsByType( $metaReviewType ); |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -74,21 +74,21 @@ discard block |
||
74 | 74 | * @param string $status |
75 | 75 | * @return array |
76 | 76 | */ |
77 | - public function getReviewsMeta($key, $status = 'publish') |
|
77 | + public function getReviewsMeta( $key, $status = 'publish' ) |
|
78 | 78 | { |
79 | - return glsr(SqlQueries::class)->getReviewsMeta($key, $status); |
|
79 | + return glsr( SqlQueries::class )->getReviewsMeta( $key, $status ); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
83 | 83 | * @param string $field |
84 | 84 | * @return array |
85 | 85 | */ |
86 | - public function getTermIds(array $values, $field) |
|
86 | + public function getTermIds( array $values, $field ) |
|
87 | 87 | { |
88 | 88 | $termIds = []; |
89 | - foreach ($values as $value) { |
|
90 | - $term = get_term_by($field, $value, Application::TAXONOMY); |
|
91 | - if (!isset($term->term_id)) { |
|
89 | + foreach( $values as $value ) { |
|
90 | + $term = get_term_by( $field, $value, Application::TAXONOMY ); |
|
91 | + if( !isset($term->term_id) ) { |
|
92 | 92 | continue; |
93 | 93 | } |
94 | 94 | $termIds[] = $term->term_id; |
@@ -99,17 +99,17 @@ discard block |
||
99 | 99 | /** |
100 | 100 | * @return array |
101 | 101 | */ |
102 | - public function getTerms(array $args = []) |
|
102 | + public function getTerms( array $args = [] ) |
|
103 | 103 | { |
104 | - $args = wp_parse_args($args, [ |
|
104 | + $args = wp_parse_args( $args, [ |
|
105 | 105 | 'count' => false, |
106 | 106 | 'fields' => 'id=>name', |
107 | 107 | 'hide_empty' => false, |
108 | 108 | 'taxonomy' => Application::TAXONOMY, |
109 | - ]); |
|
110 | - $terms = get_terms($args); |
|
111 | - if (is_wp_error($terms)) { |
|
112 | - glsr_log()->error($terms->get_error_message()); |
|
109 | + ] ); |
|
110 | + $terms = get_terms( $args ); |
|
111 | + if( is_wp_error( $terms ) ) { |
|
112 | + glsr_log()->error( $terms->get_error_message() ); |
|
113 | 113 | return []; |
114 | 114 | } |
115 | 115 | return $terms; |
@@ -119,36 +119,36 @@ discard block |
||
119 | 119 | * @param string $searchTerm |
120 | 120 | * @return void|string |
121 | 121 | */ |
122 | - public function searchPosts($searchTerm) |
|
122 | + public function searchPosts( $searchTerm ) |
|
123 | 123 | { |
124 | 124 | $args = [ |
125 | 125 | 'post_status' => 'publish', |
126 | 126 | 'post_type' => 'any', |
127 | 127 | ]; |
128 | - if (is_numeric($searchTerm)) { |
|
128 | + if( is_numeric( $searchTerm ) ) { |
|
129 | 129 | $args['post__in'] = [$searchTerm]; |
130 | 130 | } else { |
131 | 131 | $args['orderby'] = 'relevance'; |
132 | 132 | $args['posts_per_page'] = 10; |
133 | 133 | $args['s'] = $searchTerm; |
134 | 134 | } |
135 | - $queryBuilder = glsr(QueryBuilder::class); |
|
136 | - add_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2); |
|
137 | - $search = new WP_Query($args); |
|
138 | - remove_filter('posts_search', [$queryBuilder, 'filterSearchByTitle'], 500); |
|
139 | - if (!$search->have_posts()) { |
|
135 | + $queryBuilder = glsr( QueryBuilder::class ); |
|
136 | + add_filter( 'posts_search', [$queryBuilder, 'filterSearchByTitle'], 500, 2 ); |
|
137 | + $search = new WP_Query( $args ); |
|
138 | + remove_filter( 'posts_search', [$queryBuilder, 'filterSearchByTitle'], 500 ); |
|
139 | + if( !$search->have_posts() ) { |
|
140 | 140 | return; |
141 | 141 | } |
142 | 142 | $results = ''; |
143 | - while ($search->have_posts()) { |
|
143 | + while( $search->have_posts() ) { |
|
144 | 144 | $search->the_post(); |
145 | 145 | ob_start(); |
146 | - glsr()->render('partials/editor/search-result', [ |
|
146 | + glsr()->render( 'partials/editor/search-result', [ |
|
147 | 147 | 'ID' => get_the_ID(), |
148 | - 'permalink' => esc_url((string) get_permalink()), |
|
149 | - 'title' => esc_attr(get_the_title()), |
|
150 | - ]); |
|
151 | - $results.= ob_get_clean(); |
|
148 | + 'permalink' => esc_url( (string)get_permalink() ), |
|
149 | + 'title' => esc_attr( get_the_title() ), |
|
150 | + ] ); |
|
151 | + $results .= ob_get_clean(); |
|
152 | 152 | } |
153 | 153 | wp_reset_postdata(); |
154 | 154 | return $results; |
@@ -160,10 +160,10 @@ discard block |
||
160 | 160 | * @param mixed $value |
161 | 161 | * @return int|bool |
162 | 162 | */ |
163 | - public function set($postId, $key, $value) |
|
163 | + public function set( $postId, $key, $value ) |
|
164 | 164 | { |
165 | - $key = Str::prefix('_', $key); |
|
166 | - return update_post_meta($postId, $key, $value); |
|
165 | + $key = Str::prefix( '_', $key ); |
|
166 | + return update_post_meta( $postId, $key, $value ); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -172,8 +172,8 @@ discard block |
||
172 | 172 | * @param mixed $value |
173 | 173 | * @return int|bool |
174 | 174 | */ |
175 | - public function update($postId, $key, $value) |
|
175 | + public function update( $postId, $key, $value ) |
|
176 | 176 | { |
177 | - return $this->set($postId, $key, $value); |
|
177 | + return $this->set( $postId, $key, $value ); |
|
178 | 178 | } |
179 | 179 | } |
@@ -1,33 +1,33 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'rating' => [ |
|
5 | - 'label' => __('Your overall rating', 'site-reviews'), |
|
6 | - 'type' => 'rating', |
|
7 | - ], |
|
8 | - 'title' => [ |
|
9 | - 'label' => __('Title of your review', 'site-reviews'), |
|
10 | - 'placeholder' => __('Summarize your review or highlight an interesting detail', 'site-reviews'), |
|
11 | - 'type' => 'text', |
|
12 | - ], |
|
13 | - 'content' => [ |
|
14 | - 'label' => __('Your review', 'site-reviews'), |
|
15 | - 'placeholder' => __('Tell people your review', 'site-reviews'), |
|
16 | - 'rows' => 5, |
|
17 | - 'type' => 'textarea', |
|
18 | - ], |
|
19 | - 'name' => [ |
|
20 | - 'label' => __('Your name', 'site-reviews'), |
|
21 | - 'placeholder' => __('Tell us your name', 'site-reviews'), |
|
22 | - 'type' => 'text', |
|
23 | - ], |
|
24 | - 'email' => [ |
|
25 | - 'label' => __('Your email', 'site-reviews'), |
|
26 | - 'placeholder' => __('Tell us your email', 'site-reviews'), |
|
27 | - 'type' => 'email', |
|
28 | - ], |
|
29 | - 'terms' => [ |
|
30 | - 'label' => __('This review is based on my own experience and is my genuine opinion.', 'site-reviews'), |
|
31 | - 'type' => 'checkbox', |
|
32 | - ], |
|
4 | + 'rating' => [ |
|
5 | + 'label' => __('Your overall rating', 'site-reviews'), |
|
6 | + 'type' => 'rating', |
|
7 | + ], |
|
8 | + 'title' => [ |
|
9 | + 'label' => __('Title of your review', 'site-reviews'), |
|
10 | + 'placeholder' => __('Summarize your review or highlight an interesting detail', 'site-reviews'), |
|
11 | + 'type' => 'text', |
|
12 | + ], |
|
13 | + 'content' => [ |
|
14 | + 'label' => __('Your review', 'site-reviews'), |
|
15 | + 'placeholder' => __('Tell people your review', 'site-reviews'), |
|
16 | + 'rows' => 5, |
|
17 | + 'type' => 'textarea', |
|
18 | + ], |
|
19 | + 'name' => [ |
|
20 | + 'label' => __('Your name', 'site-reviews'), |
|
21 | + 'placeholder' => __('Tell us your name', 'site-reviews'), |
|
22 | + 'type' => 'text', |
|
23 | + ], |
|
24 | + 'email' => [ |
|
25 | + 'label' => __('Your email', 'site-reviews'), |
|
26 | + 'placeholder' => __('Tell us your email', 'site-reviews'), |
|
27 | + 'type' => 'email', |
|
28 | + ], |
|
29 | + 'terms' => [ |
|
30 | + 'label' => __('This review is based on my own experience and is my genuine opinion.', 'site-reviews'), |
|
31 | + 'type' => 'checkbox', |
|
32 | + ], |
|
33 | 33 | ]; |
@@ -2,32 +2,32 @@ |
||
2 | 2 | |
3 | 3 | return [ |
4 | 4 | 'rating' => [ |
5 | - 'label' => __('Your overall rating', 'site-reviews'), |
|
5 | + 'label' => __( 'Your overall rating', 'site-reviews' ), |
|
6 | 6 | 'type' => 'rating', |
7 | 7 | ], |
8 | 8 | 'title' => [ |
9 | - 'label' => __('Title of your review', 'site-reviews'), |
|
10 | - 'placeholder' => __('Summarize your review or highlight an interesting detail', 'site-reviews'), |
|
9 | + 'label' => __( 'Title of your review', 'site-reviews' ), |
|
10 | + 'placeholder' => __( 'Summarize your review or highlight an interesting detail', 'site-reviews' ), |
|
11 | 11 | 'type' => 'text', |
12 | 12 | ], |
13 | 13 | 'content' => [ |
14 | - 'label' => __('Your review', 'site-reviews'), |
|
15 | - 'placeholder' => __('Tell people your review', 'site-reviews'), |
|
14 | + 'label' => __( 'Your review', 'site-reviews' ), |
|
15 | + 'placeholder' => __( 'Tell people your review', 'site-reviews' ), |
|
16 | 16 | 'rows' => 5, |
17 | 17 | 'type' => 'textarea', |
18 | 18 | ], |
19 | 19 | 'name' => [ |
20 | - 'label' => __('Your name', 'site-reviews'), |
|
21 | - 'placeholder' => __('Tell us your name', 'site-reviews'), |
|
20 | + 'label' => __( 'Your name', 'site-reviews' ), |
|
21 | + 'placeholder' => __( 'Tell us your name', 'site-reviews' ), |
|
22 | 22 | 'type' => 'text', |
23 | 23 | ], |
24 | 24 | 'email' => [ |
25 | - 'label' => __('Your email', 'site-reviews'), |
|
26 | - 'placeholder' => __('Tell us your email', 'site-reviews'), |
|
25 | + 'label' => __( 'Your email', 'site-reviews' ), |
|
26 | + 'placeholder' => __( 'Tell us your email', 'site-reviews' ), |
|
27 | 27 | 'type' => 'email', |
28 | 28 | ], |
29 | 29 | 'terms' => [ |
30 | - 'label' => __('This review is based on my own experience and is my genuine opinion.', 'site-reviews'), |
|
30 | + 'label' => __( 'This review is based on my own experience and is my genuine opinion.', 'site-reviews' ), |
|
31 | 31 | 'type' => 'checkbox', |
32 | 32 | ], |
33 | 33 | ]; |
@@ -1,8 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'fields' => [ |
|
5 | - 'input' => 'ninja-forms-field nf-element', |
|
6 | - 'textarea' => 'ninja-forms-field nf-element', |
|
7 | - ], |
|
4 | + 'fields' => [ |
|
5 | + 'input' => 'ninja-forms-field nf-element', |
|
6 | + 'textarea' => 'ninja-forms-field nf-element', |
|
7 | + ], |
|
8 | 8 | ]; |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'fields' => [ |
|
5 | - 'input' => 'wpcf7-form-control', |
|
6 | - 'input_text' => 'wpcf7-form-control wpcf7-text', |
|
7 | - 'input_email' => 'wpcf7-form-control wpcf7-text wpcf7-email', |
|
8 | - 'select' => 'wpcf7-form-control wpcf7-select', |
|
9 | - 'textarea' => 'wpcf7-form-control wpcf7-textarea', |
|
10 | - ], |
|
11 | - 'validation' => [ |
|
12 | - 'error_tag' => 'span', |
|
13 | - 'error_tag_class' => 'wpcf7-not-valid-tip', |
|
14 | - 'input_error_class' => 'wpcf7-not-valid', |
|
15 | - 'message_initial_class' => 'wpcf7-display-none', |
|
16 | - 'message_success_class' => 'wpcf7-mail-sent-ok', |
|
17 | - 'message_tag_class' => 'wpcf7-response-output', |
|
18 | - ], |
|
4 | + 'fields' => [ |
|
5 | + 'input' => 'wpcf7-form-control', |
|
6 | + 'input_text' => 'wpcf7-form-control wpcf7-text', |
|
7 | + 'input_email' => 'wpcf7-form-control wpcf7-text wpcf7-email', |
|
8 | + 'select' => 'wpcf7-form-control wpcf7-select', |
|
9 | + 'textarea' => 'wpcf7-form-control wpcf7-textarea', |
|
10 | + ], |
|
11 | + 'validation' => [ |
|
12 | + 'error_tag' => 'span', |
|
13 | + 'error_tag_class' => 'wpcf7-not-valid-tip', |
|
14 | + 'input_error_class' => 'wpcf7-not-valid', |
|
15 | + 'message_initial_class' => 'wpcf7-display-none', |
|
16 | + 'message_success_class' => 'wpcf7-mail-sent-ok', |
|
17 | + 'message_tag_class' => 'wpcf7-response-output', |
|
18 | + ], |
|
19 | 19 | ]; |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'fields' => [ |
|
5 | - 'input' => 'wpforms-field-large', |
|
6 | - 'label' => 'wpforms-field-label', |
|
7 | - 'label_checkbox' => 'wpforms-field-label-inline', |
|
8 | - 'label_radio' => 'wpforms-field-label-inline', |
|
9 | - 'select' => 'wpforms-field-large', |
|
10 | - 'textarea' => 'wpforms-field-large', |
|
11 | - ], |
|
4 | + 'fields' => [ |
|
5 | + 'input' => 'wpforms-field-large', |
|
6 | + 'label' => 'wpforms-field-label', |
|
7 | + 'label_checkbox' => 'wpforms-field-label-inline', |
|
8 | + 'label_radio' => 'wpforms-field-label-inline', |
|
9 | + 'select' => 'wpforms-field-large', |
|
10 | + 'textarea' => 'wpforms-field-large', |
|
11 | + ], |
|
12 | 12 | ]; |
@@ -1,19 +1,19 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'fields' => [ |
|
5 | - 'input' => 'form-control', |
|
6 | - 'input_checkbox' => 'custom-control-input', |
|
7 | - 'input_radio' => 'custom-control-input', |
|
8 | - 'label_checkbox' => 'custom-control-label', |
|
9 | - 'label_radio' => 'custom-control-label', |
|
10 | - 'select' => 'form-control', |
|
11 | - 'textarea' => 'form-control', |
|
12 | - ], |
|
13 | - 'validation' => [ |
|
14 | - 'error_tag' => 'div', |
|
15 | - 'error_tag_class' => 'invalid-feedback', |
|
16 | - 'field_class' => 'form-group', |
|
17 | - 'input_error_class' => 'is-invalid', |
|
18 | - ], |
|
4 | + 'fields' => [ |
|
5 | + 'input' => 'form-control', |
|
6 | + 'input_checkbox' => 'custom-control-input', |
|
7 | + 'input_radio' => 'custom-control-input', |
|
8 | + 'label_checkbox' => 'custom-control-label', |
|
9 | + 'label_radio' => 'custom-control-label', |
|
10 | + 'select' => 'form-control', |
|
11 | + 'textarea' => 'form-control', |
|
12 | + ], |
|
13 | + 'validation' => [ |
|
14 | + 'error_tag' => 'div', |
|
15 | + 'error_tag_class' => 'invalid-feedback', |
|
16 | + 'field_class' => 'form-group', |
|
17 | + 'input_error_class' => 'is-invalid', |
|
18 | + ], |
|
19 | 19 | ]; |