@@ -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 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | |
25 | 25 | // append plugin information |
26 | 26 | // Note: is_admin() was used previously, however this prevents jetpack manage & ManageWP from working |
27 | - add_filter('plugins_api', array($this, 'inject_info'), 20, 3); |
|
27 | + add_filter('plugins_api', array($this, 'inject_info'), 20, 3); |
|
28 | 28 | |
29 | 29 | |
30 | 30 | // append update information |
@@ -59,33 +59,33 @@ discard block |
||
59 | 59 | |
60 | 60 | |
61 | 61 | // validate |
62 | - if( isset($args->slug) && $args->slug == $slug ) { |
|
62 | + if( isset($args->slug) && $args->slug == $slug ) { |
|
63 | 63 | |
64 | - $info = acf_pro_get_remote_info(); |
|
65 | - $sections = acf_extract_vars($info, array( |
|
66 | - 'description', |
|
67 | - 'installation', |
|
68 | - 'changelog', |
|
69 | - 'upgrade_notice', |
|
70 | - )); |
|
64 | + $info = acf_pro_get_remote_info(); |
|
65 | + $sections = acf_extract_vars($info, array( |
|
66 | + 'description', |
|
67 | + 'installation', |
|
68 | + 'changelog', |
|
69 | + 'upgrade_notice', |
|
70 | + )); |
|
71 | 71 | |
72 | - $obj = new stdClass(); |
|
72 | + $obj = new stdClass(); |
|
73 | 73 | |
74 | - foreach( $info as $k => $v ) { |
|
74 | + foreach( $info as $k => $v ) { |
|
75 | 75 | |
76 | - $obj->$k = $v; |
|
76 | + $obj->$k = $v; |
|
77 | 77 | |
78 | - } |
|
78 | + } |
|
79 | 79 | |
80 | - $obj->sections = $sections; |
|
80 | + $obj->sections = $sections; |
|
81 | 81 | |
82 | - return $obj; |
|
82 | + return $obj; |
|
83 | 83 | |
84 | - } |
|
84 | + } |
|
85 | 85 | |
86 | 86 | |
87 | - // return |
|
88 | - return $result; |
|
87 | + // return |
|
88 | + return $result; |
|
89 | 89 | |
90 | 90 | } |
91 | 91 | |
@@ -133,22 +133,22 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | |
136 | - // vars |
|
136 | + // vars |
|
137 | 137 | $info = acf_pro_get_remote_info(); |
138 | 138 | $basename = acf_get_setting('basename'); |
139 | 139 | $slug = acf_get_setting('slug'); |
140 | 140 | |
141 | 141 | |
142 | - // create new object for update |
|
143 | - $obj = new stdClass(); |
|
144 | - $obj->slug = $slug; |
|
145 | - $obj->plugin = $basename; |
|
146 | - $obj->new_version = $info['version']; |
|
147 | - $obj->url = $info['homepage']; |
|
148 | - $obj->package = ''; |
|
142 | + // create new object for update |
|
143 | + $obj = new stdClass(); |
|
144 | + $obj->slug = $slug; |
|
145 | + $obj->plugin = $basename; |
|
146 | + $obj->new_version = $info['version']; |
|
147 | + $obj->url = $info['homepage']; |
|
148 | + $obj->package = ''; |
|
149 | 149 | |
150 | 150 | |
151 | - // license |
|
151 | + // license |
|
152 | 152 | if( acf_pro_is_license_active() ) { |
153 | 153 | |
154 | 154 | $obj->package = acf_pro_get_remote_url('download', array( |
@@ -161,12 +161,12 @@ discard block |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | |
164 | - // add to transient |
|
165 | - $transient->response[ $basename ] = $obj; |
|
164 | + // add to transient |
|
165 | + $transient->response[ $basename ] = $obj; |
|
166 | 166 | |
167 | 167 | |
168 | 168 | // return |
169 | - return $transient; |
|
169 | + return $transient; |
|
170 | 170 | |
171 | 171 | } |
172 | 172 |
@@ -55,7 +55,7 @@ |
||
55 | 55 | |
56 | 56 | |
57 | 57 | // do not delete! |
58 | - parent::__construct(); |
|
58 | + parent::__construct(); |
|
59 | 59 | |
60 | 60 | } |
61 | 61 |
@@ -70,7 +70,7 @@ |
||
70 | 70 | |
71 | 71 | |
72 | 72 | // do not delete! |
73 | - parent::__construct(); |
|
73 | + parent::__construct(); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | |
51 | 51 | |
52 | 52 | // do not delete! |
53 | - parent::__construct(); |
|
53 | + parent::__construct(); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 |