@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | ); |
45 | 45 | |
46 | 46 | |
47 | - // Create an acf version of the_content filter (acf_the_content) |
|
47 | + // Create an acf version of the_content filter (acf_the_content) |
|
48 | 48 | if( !empty($GLOBALS['wp_embed']) ) { |
49 | 49 | |
50 | 50 | add_filter( 'acf_the_content', array( $GLOBALS['wp_embed'], 'run_shortcode' ), 8 ); |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | |
75 | 75 | // do not delete! |
76 | - parent::__construct(); |
|
76 | + parent::__construct(); |
|
77 | 77 | |
78 | 78 | } |
79 | 79 |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | |
248 | 248 | |
249 | 249 | $form_fields[ 'acf-form-data' ] = array( |
250 | - 'label' => '', |
|
250 | + 'label' => '', |
|
251 | 251 | 'input' => 'html', |
252 | 252 | 'html' => $html |
253 | 253 | ); |
@@ -284,8 +284,8 @@ discard block |
||
284 | 284 | } |
285 | 285 | |
286 | 286 | |
287 | - // validate and save |
|
288 | - if( acf_validate_save_post(true) ) { |
|
287 | + // validate and save |
|
288 | + if( acf_validate_save_post(true) ) { |
|
289 | 289 | |
290 | 290 | acf_save_post( $post['ID'] ); |
291 | 291 |
@@ -258,8 +258,8 @@ |
||
258 | 258 | } |
259 | 259 | |
260 | 260 | |
261 | - // validate and save |
|
262 | - if( acf_validate_save_post(true) ) { |
|
261 | + // validate and save |
|
262 | + if( acf_validate_save_post(true) ) { |
|
263 | 263 | |
264 | 264 | acf_save_post( "comment_{$comment_id}" ); |
265 | 265 |
@@ -395,8 +395,8 @@ |
||
395 | 395 | |
396 | 396 | |
397 | 397 | |
398 | - // save data |
|
399 | - if( acf_validate_save_post(true) ) { |
|
398 | + // save data |
|
399 | + if( acf_validate_save_post(true) ) { |
|
400 | 400 | |
401 | 401 | acf_save_post("{$taxonomy}_{$term_id}"); |
402 | 402 |
@@ -382,8 +382,8 @@ |
||
382 | 382 | } |
383 | 383 | |
384 | 384 | |
385 | - // save data |
|
386 | - if( acf_validate_save_post(true) ) { |
|
385 | + // save data |
|
386 | + if( acf_validate_save_post(true) ) { |
|
387 | 387 | |
388 | 388 | acf_save_post( "user_{$user_id}" ); |
389 | 389 |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | $id = acf_maybe_get($_POST, 'widget-id'); |
182 | 182 | |
183 | 183 | |
184 | - // save data |
|
185 | - if( $id && acf_validate_save_post() ) { |
|
184 | + // save data |
|
185 | + if( $id && acf_validate_save_post() ) { |
|
186 | 186 | |
187 | 187 | acf_save_post( "widget_{$id}" ); |
188 | 188 | |
@@ -218,8 +218,8 @@ discard block |
||
218 | 218 | } |
219 | 219 | |
220 | 220 | |
221 | - // save |
|
222 | - if( acf_validate_save_post() ) { |
|
221 | + // save |
|
222 | + if( acf_validate_save_post() ) { |
|
223 | 223 | |
224 | 224 | acf_save_post( "widget_{$widget->id}" ); |
225 | 225 |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | |
46 | 46 | function rule_types( $choices ) { |
47 | 47 | |
48 | - $choices[ __("Forms",'acf') ]['options_page'] = __("Options Page",'acf'); |
|
48 | + $choices[ __("Forms",'acf') ]['options_page'] = __("Options Page",'acf'); |
|
49 | 49 | |
50 | - return $choices; |
|
50 | + return $choices; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | |
88 | 88 | // return |
89 | - return $choices; |
|
89 | + return $choices; |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | |
@@ -129,19 +129,19 @@ discard block |
||
129 | 129 | // match |
130 | 130 | if( $rule['operator'] == "==" ) { |
131 | 131 | |
132 | - $match = ( $options_page === $rule['value'] ); |
|
132 | + $match = ( $options_page === $rule['value'] ); |
|
133 | 133 | |
134 | - } elseif( $rule['operator'] == "!=" ) { |
|
134 | + } elseif( $rule['operator'] == "!=" ) { |
|
135 | 135 | |
136 | - $match = ( $options_page !== $rule['value'] ); |
|
136 | + $match = ( $options_page !== $rule['value'] ); |
|
137 | 137 | |
138 | - } |
|
138 | + } |
|
139 | 139 | |
140 | 140 | |
141 | - // return |
|
142 | - return $match; |
|
141 | + // return |
|
142 | + return $match; |
|
143 | 143 | |
144 | - } |
|
144 | + } |
|
145 | 145 | |
146 | 146 | |
147 | 147 | /* |
@@ -216,17 +216,17 @@ discard block |
||
216 | 216 | if( acf_verify_nonce('options') ) { |
217 | 217 | |
218 | 218 | // save data |
219 | - if( acf_validate_save_post(true) ) { |
|
219 | + if( acf_validate_save_post(true) ) { |
|
220 | 220 | |
221 | - // get post_id (allow lang modification) |
|
222 | - $post_id = acf_get_valid_post_id($this->page['post_id']); |
|
221 | + // get post_id (allow lang modification) |
|
222 | + $post_id = acf_get_valid_post_id($this->page['post_id']); |
|
223 | 223 | |
224 | 224 | |
225 | - // set autoload |
|
226 | - acf_update_setting('autoload', $this->page['autoload']); |
|
225 | + // set autoload |
|
226 | + acf_update_setting('autoload', $this->page['autoload']); |
|
227 | 227 | |
228 | 228 | |
229 | - // save |
|
229 | + // save |
|
230 | 230 | acf_save_post( $post_id ); |
231 | 231 | |
232 | 232 |
@@ -132,77 +132,77 @@ |
||
132 | 132 | |
133 | 133 | |
134 | 134 | // validate |
135 | - if( empty($info) ) { |
|
135 | + if( empty($info) ) { |
|
136 | 136 | |
137 | - acf_add_admin_notice( __('<b>Error</b>. Could not connect to update server', 'acf'), 'error'); |
|
138 | - return; |
|
137 | + acf_add_admin_notice( __('<b>Error</b>. Could not connect to update server', 'acf'), 'error'); |
|
138 | + return; |
|
139 | 139 | |
140 | - } |
|
140 | + } |
|
141 | 141 | |
142 | 142 | |
143 | - // add info to view |
|
144 | - $this->view['remote_version'] = $info['version']; |
|
143 | + // add info to view |
|
144 | + $this->view['remote_version'] = $info['version']; |
|
145 | 145 | |
146 | 146 | |
147 | - // add changelog if the remote version is '>' than the current version |
|
147 | + // add changelog if the remote version is '>' than the current version |
|
148 | 148 | if( acf_pro_is_update_available() ) |
149 | - { |
|
150 | - $this->view['update_available'] = true; |
|
149 | + { |
|
150 | + $this->view['update_available'] = true; |
|
151 | 151 | |
152 | 152 | |
153 | - // changelog |
|
154 | - $changelogs = explode('<h4>', $info['changelog']); |
|
153 | + // changelog |
|
154 | + $changelogs = explode('<h4>', $info['changelog']); |
|
155 | 155 | |
156 | - foreach( $changelogs as $changelog ) |
|
157 | - { |
|
158 | - // validate (first segment is always empty due to explode) |
|
159 | - if( empty($changelog) ) |
|
160 | - { |
|
161 | - continue; |
|
162 | - } |
|
156 | + foreach( $changelogs as $changelog ) |
|
157 | + { |
|
158 | + // validate (first segment is always empty due to explode) |
|
159 | + if( empty($changelog) ) |
|
160 | + { |
|
161 | + continue; |
|
162 | + } |
|
163 | 163 | |
164 | 164 | |
165 | - // explode |
|
166 | - $changelog = explode('</h4>', $changelog); |
|
167 | - $changelog_version = trim($changelog[0]); |
|
168 | - $changelog_text = trim($changelog[1]); |
|
169 | - $changelog_text = str_replace('<ul>', '<ul class="ul-disc">', $changelog_text); |
|
165 | + // explode |
|
166 | + $changelog = explode('</h4>', $changelog); |
|
167 | + $changelog_version = trim($changelog[0]); |
|
168 | + $changelog_text = trim($changelog[1]); |
|
169 | + $changelog_text = str_replace('<ul>', '<ul class="ul-disc">', $changelog_text); |
|
170 | 170 | |
171 | - if( version_compare($this->view['remote_version'], $changelog_version, '==') ) |
|
172 | - { |
|
173 | - $this->view['changelog'] = $changelog_text; |
|
174 | - break; |
|
175 | - } |
|
171 | + if( version_compare($this->view['remote_version'], $changelog_version, '==') ) |
|
172 | + { |
|
173 | + $this->view['changelog'] = $changelog_text; |
|
174 | + break; |
|
175 | + } |
|
176 | 176 | |
177 | - } |
|
177 | + } |
|
178 | 178 | |
179 | 179 | |
180 | - // upgrade_notice |
|
181 | - $upgrade_notices = explode('<h4>', $info['upgrade_notice']); |
|
180 | + // upgrade_notice |
|
181 | + $upgrade_notices = explode('<h4>', $info['upgrade_notice']); |
|
182 | 182 | |
183 | - foreach( $upgrade_notices as $upgrade_notice ) |
|
184 | - { |
|
185 | - // validate (first segment is always empty due to explode) |
|
186 | - if( empty($upgrade_notice) ) |
|
187 | - { |
|
188 | - continue; |
|
189 | - } |
|
183 | + foreach( $upgrade_notices as $upgrade_notice ) |
|
184 | + { |
|
185 | + // validate (first segment is always empty due to explode) |
|
186 | + if( empty($upgrade_notice) ) |
|
187 | + { |
|
188 | + continue; |
|
189 | + } |
|
190 | 190 | |
191 | 191 | |
192 | - // explode |
|
193 | - $upgrade_notice = explode('</h4>', $upgrade_notice); |
|
194 | - $upgrade_version = trim($upgrade_notice[0]); |
|
195 | - $upgrade_text = trim($upgrade_notice[1]); |
|
196 | - $upgrade_text = str_replace('<ul>', '<ul class="ul-disc">', $upgrade_text); |
|
192 | + // explode |
|
193 | + $upgrade_notice = explode('</h4>', $upgrade_notice); |
|
194 | + $upgrade_version = trim($upgrade_notice[0]); |
|
195 | + $upgrade_text = trim($upgrade_notice[1]); |
|
196 | + $upgrade_text = str_replace('<ul>', '<ul class="ul-disc">', $upgrade_text); |
|
197 | 197 | |
198 | - if( version_compare($this->view['current_version'], $upgrade_version, '<') ) |
|
199 | - { |
|
200 | - $this->view['upgrade_notice'] = $upgrade_text; |
|
201 | - break; |
|
202 | - } |
|
198 | + if( version_compare($this->view['current_version'], $upgrade_version, '<') ) |
|
199 | + { |
|
200 | + $this->view['upgrade_notice'] = $upgrade_text; |
|
201 | + break; |
|
202 | + } |
|
203 | 203 | |
204 | - } |
|
205 | - } |
|
204 | + } |
|
205 | + } |
|
206 | 206 | |
207 | 207 | |
208 | 208 | } |
@@ -85,15 +85,15 @@ discard block |
||
85 | 85 | |
86 | 86 | |
87 | 87 | // return body |
88 | - if( !is_wp_error($request) || wp_remote_retrieve_response_code($request) === 200) { |
|
88 | + if( !is_wp_error($request) || wp_remote_retrieve_response_code($request) === 200) { |
|
89 | 89 | |
90 | - return $request['body']; |
|
90 | + return $request['body']; |
|
91 | 91 | |
92 | - } |
|
92 | + } |
|
93 | 93 | |
94 | 94 | |
95 | - // return |
|
96 | - return 0; |
|
95 | + // return |
|
96 | + return 0; |
|
97 | 97 | |
98 | 98 | } |
99 | 99 | |
@@ -126,12 +126,12 @@ discard block |
||
126 | 126 | } |
127 | 127 | |
128 | 128 | |
129 | - // return false if the external version is '<=' the current version |
|
129 | + // return false if the external version is '<=' the current version |
|
130 | 130 | if( version_compare($info['version'], $version, '<=') ) { |
131 | 131 | |
132 | - return false; |
|
132 | + return false; |
|
133 | 133 | |
134 | - } |
|
134 | + } |
|
135 | 135 | |
136 | 136 | |
137 | 137 | // return |
@@ -187,20 +187,20 @@ discard block |
||
187 | 187 | $timeout = 12 * HOUR_IN_SECONDS; |
188 | 188 | |
189 | 189 | |
190 | - // decode |
|
191 | - if( !empty($info) ) { |
|
190 | + // decode |
|
191 | + if( !empty($info) ) { |
|
192 | 192 | |
193 | 193 | $info = json_decode($info, true); |
194 | 194 | |
195 | 195 | // fake info version |
196 | - //$info['version'] = '6.0.0'; |
|
196 | + //$info['version'] = '6.0.0'; |
|
197 | 197 | |
198 | - } else { |
|
198 | + } else { |
|
199 | 199 | |
200 | - $info = 0; // allow transient to be returned, but empty to validate |
|
201 | - $timeout = 2 * HOUR_IN_SECONDS; |
|
200 | + $info = 0; // allow transient to be returned, but empty to validate |
|
201 | + $timeout = 2 * HOUR_IN_SECONDS; |
|
202 | 202 | |
203 | - } |
|
203 | + } |
|
204 | 204 | |
205 | 205 | |
206 | 206 | // update transient |