@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function __construct( $oFactory, $aSavedData, $aArguments, $aSectionsets, $aFieldsets ) { |
30 | 30 | |
31 | - $this->oFactory = $oFactory; |
|
31 | + $this->oFactory = $oFactory; |
|
32 | 32 | |
33 | 33 | // add_action |
34 | 34 | // @deprecated 3.7.0 |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function _handleFormData() { |
73 | 73 | |
74 | - if ( ! $this->_shouldProceed() ) { |
|
74 | + if ( !$this->_shouldProceed() ) { |
|
75 | 75 | return; |
76 | 76 | } |
77 | 77 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | new AdminPageFramework_Model__FormSubmission__Validator( $this->oFactory ); |
128 | 128 | |
129 | 129 | // [3.6.3+] Apply filters. All the sub-routines of handling form submit data use this filter hook. |
130 | - $_aInputs = $this->addAndApplyFilters( |
|
130 | + $_aInputs = $this->addAndApplyFilters( |
|
131 | 131 | $this->oFactory, |
132 | 132 | "validation_pre_{$this->oFactory->oProp->sClassName}", |
133 | 133 | $_aInputs, |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | |
139 | 139 | // Save the data. |
140 | 140 | $_bUpdated = false; |
141 | - if ( ! $this->oFactory->oProp->_bDisableSavingOptions ) { |
|
141 | + if ( !$this->oFactory->oProp->_bDisableSavingOptions ) { |
|
142 | 142 | $_bUpdated = $this->oFactory->oProp->updateOption( $_aInputs ); |
143 | 143 | } |
144 | 144 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | private function _shouldProceed() { |
178 | 178 | |
179 | 179 | if ( |
180 | - ! isset( |
|
180 | + !isset( |
|
181 | 181 | $_POST[ 'admin_page_framework_start' ], // indicates the framework form is started |
182 | 182 | $_POST[ '_wp_http_referer' ] |
183 | 183 | ) |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | |
195 | 195 | // Check if all the form fields are sent. |
196 | 196 | if ( |
197 | - ! isset( |
|
197 | + !isset( |
|
198 | 198 | // these keys are supposed to be embedded at the end of the form. |
199 | 199 | // if the server truncates the form input values for `max_input_vars`, these will be lost in PHP 5.3.9 or above. |
200 | 200 | $_POST[ '_is_admin_page_framework' ], // holds the form nonce |
@@ -214,11 +214,11 @@ discard block |
||
214 | 214 | return false; |
215 | 215 | } |
216 | 216 | |
217 | - $_bVerifyNonce = wp_verify_nonce( |
|
217 | + $_bVerifyNonce = wp_verify_nonce( |
|
218 | 218 | $_POST[ '_is_admin_page_framework' ], |
219 | - 'form_' . md5( $this->oFactory->oProp->sClassName . get_current_user_id() ) |
|
219 | + 'form_'.md5( $this->oFactory->oProp->sClassName.get_current_user_id() ) |
|
220 | 220 | ); |
221 | - if ( ! $_bVerifyNonce ) { |
|
221 | + if ( !$_bVerifyNonce ) { |
|
222 | 222 | $this->oFactory->setAdminNotice( $this->oFactory->oMsg->get( 'nonce_verification_failed' ) ); |
223 | 223 | return false; |
224 | 224 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | */ |
233 | 233 | private function _getUserInputsFromPOST() { |
234 | 234 | |
235 | - $_aInputs = $this->getElementAsArray( |
|
235 | + $_aInputs = $this->getElementAsArray( |
|
236 | 236 | $_POST, // will be sanitized in the getSubmittedData() method. |
237 | 237 | $this->oFactory->oProp->sOptionKey, |
238 | 238 | array() |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | $this->oFactory, |
266 | 266 | array( |
267 | 267 | // @todo deprecate the hook with the input ID |
268 | - "submit_{$this->oFactory->oProp->sClassName}_{$_sPressedInputID}", // will be deprecated in near future release |
|
268 | + "submit_{$this->oFactory->oProp->sClassName}_{$_sPressedInputID}", // will be deprecated in near future release |
|
269 | 269 | $_sSubmitSectionID |
270 | 270 | ? "submit_{$this->oFactory->oProp->sClassName}_{$_sSubmitSectionID}_{$_sPressedFieldID}" |
271 | 271 | : "submit_{$this->oFactory->oProp->sClassName}_{$_sPressedFieldID}", |
@@ -348,9 +348,9 @@ discard block |
||
348 | 348 | |
349 | 349 | // Drop the 'field_errors' key. |
350 | 350 | $_aRemoveQueries = array(); |
351 | - if ( ! isset( $aStatus[ 'field_errors' ] ) || ! $aStatus[ 'field_errors' ] ) { |
|
351 | + if ( !isset( $aStatus[ 'field_errors' ] ) || !$aStatus[ 'field_errors' ] ) { |
|
352 | 352 | unset( $aStatus[ 'field_errors' ] ); |
353 | - $_aRemoveQueries[] = 'field_errors'; |
|
353 | + $_aRemoveQueries[ ] = 'field_errors'; |
|
354 | 354 | } |
355 | 355 | |
356 | 356 | return $this->addAndApplyFilters( // 3.4.4+ |
@@ -375,7 +375,7 @@ discard block |
||
375 | 375 | */ |
376 | 376 | private function _removePageElements( $aOptions, $sPageSlug, $sTabSlug ) { |
377 | 377 | |
378 | - if ( ! $sPageSlug && ! $sTabSlug ) { |
|
378 | + if ( !$sPageSlug && !$sTabSlug ) { |
|
379 | 379 | return $aOptions; |
380 | 380 | } |
381 | 381 |
@@ -28,10 +28,10 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function __construct( $oFactory ) { |
30 | 30 | |
31 | - $this->oFactory = $oFactory; |
|
31 | + $this->oFactory = $oFactory; |
|
32 | 32 | |
33 | 33 | // Form emails. |
34 | - if ( ! isset( $_GET[ 'apf_action' ], $_GET[ 'transient' ] ) ) { |
|
34 | + if ( !isset( $_GET[ 'apf_action' ], $_GET[ 'transient' ] ) ) { |
|
35 | 35 | return; |
36 | 36 | } |
37 | 37 | if ( 'email' !== $_GET[ 'apf_action' ] ) { |
@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | self::$_bDoneEmail = true; |
74 | 74 | |
75 | 75 | $_sTransient = $this->getElement( $_GET, 'transient', '' ); |
76 | - if ( ! $_sTransient ) { |
|
76 | + if ( !$_sTransient ) { |
|
77 | 77 | return; |
78 | 78 | } |
79 | 79 | $_sTransient = sanitize_text_field( $_sTransient ); |
80 | 80 | $_aFormEmail = $this->getTransient( $_sTransient ); |
81 | 81 | $this->deleteTransient( $_sTransient ); |
82 | - if ( ! is_array( $_aFormEmail ) ) { |
|
82 | + if ( !is_array( $_aFormEmail ) ) { |
|
83 | 83 | return; |
84 | 84 | } |
85 | 85 |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | * @since 3.5.4 Added the `$aHeader` parameter. Deprecated the `$sFileName` parameter as it is included in the $aHeader definition. |
100 | 100 | * @since 2.0.0 |
101 | 101 | */ |
102 | - public function doExport( $vData, $sFormatType=null, array $aHeader=array() ) { |
|
102 | + public function doExport( $vData, $sFormatType = null, array $aHeader = array() ) { |
|
103 | 103 | |
104 | - $sFormatType = isset( $sFormatType ) |
|
104 | + $sFormatType = isset( $sFormatType ) |
|
105 | 105 | ? $sFormatType |
106 | 106 | : $this->sFormatType; |
107 | 107 | |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | * @param string $sKey |
130 | 130 | * @return void |
131 | 131 | */ |
132 | - private function _outputHTTPHeader( array $aHeader, $sKey='' ) { |
|
132 | + private function _outputHTTPHeader( array $aHeader, $sKey = '' ) { |
|
133 | 133 | |
134 | - foreach( $aHeader as $_sKey => $_asValue ) { |
|
134 | + foreach ( $aHeader as $_sKey => $_asValue ) { |
|
135 | 135 | |
136 | 136 | // Nested items. Set the key to overrider array keys. |
137 | 137 | if ( is_array( $_asValue ) ) { |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | return; |
174 | 174 | case 'json': // for json. |
175 | 175 | echo json_encode( ( array ) $vData ); |
176 | - return ; |
|
176 | + return; |
|
177 | 177 | case 'array': // for serialized PHP array. |
178 | 178 | default: // for anything else, |
179 | 179 | echo serialize( ( array ) $vData ); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function _replyToSetFooterInfo() { |
38 | 38 | |
39 | - if ( ! $this->oProp->isPageAdded() ) { |
|
39 | + if ( !$this->oProp->isPageAdded() ) { |
|
40 | 40 | return; |
41 | 41 | } |
42 | 42 | parent::_replyToSetFooterInfo(); |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function _addLinkToPluginDescription( $asLinks ) { |
58 | 58 | |
59 | - if ( ! is_array( $asLinks ) ) { |
|
60 | - $this->oProp->aPluginDescriptionLinks[] = $asLinks; |
|
59 | + if ( !is_array( $asLinks ) ) { |
|
60 | + $this->oProp->aPluginDescriptionLinks[ ] = $asLinks; |
|
61 | 61 | } else { |
62 | 62 | $this->oProp->aPluginDescriptionLinks = array_merge( |
63 | 63 | $this->oProp->aPluginDescriptionLinks, |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function _addLinkToPluginTitle( $asLinks ) { |
86 | 86 | |
87 | - if ( ! is_array( $asLinks ) ) { |
|
88 | - $this->oProp->aPluginTitleLinks[] = $asLinks; |
|
87 | + if ( !is_array( $asLinks ) ) { |
|
88 | + $this->oProp->aPluginTitleLinks[ ] = $asLinks; |
|
89 | 89 | } else { |
90 | 90 | $this->oProp->aPluginTitleLinks = array_merge( |
91 | 91 | $this->oProp->aPluginTitleLinks, |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | } |
121 | 121 | $_sPluginBaseName = plugin_basename( $this->oProp->aScriptInfo[ 'sPath' ] ); |
122 | 122 | add_filter( |
123 | - $this->_sFilterSuffix_PluginActionLinks . $_sPluginBaseName, |
|
123 | + $this->_sFilterSuffix_PluginActionLinks.$_sPluginBaseName, |
|
124 | 124 | array( $this, '_replyToAddPluginActionLinks' ) |
125 | 125 | ); |
126 | 126 | } |
@@ -133,14 +133,14 @@ discard block |
||
133 | 133 | * @return string |
134 | 134 | * @internal |
135 | 135 | */ |
136 | - public function _replyToAddInfoInFooterLeft( $sLinkHTML='' ) { |
|
136 | + public function _replyToAddInfoInFooterLeft( $sLinkHTML = '' ) { |
|
137 | 137 | |
138 | - if ( ! $this->_isPageAdded() ) { |
|
138 | + if ( !$this->_isPageAdded() ) { |
|
139 | 139 | return $sLinkHTML; // $sLinkHTML is given by the hook. |
140 | 140 | } |
141 | - $sLinkHTML = empty( $this->oProp->aScriptInfo['sName'] ) |
|
141 | + $sLinkHTML = empty( $this->oProp->aScriptInfo[ 'sName' ] ) |
|
142 | 142 | ? $sLinkHTML |
143 | - : $this->oProp->aFooterInfo['sLeft']; |
|
143 | + : $this->oProp->aFooterInfo[ 'sLeft' ]; |
|
144 | 144 | |
145 | 145 | $_sPageSlug = $this->oProp->getCurrentPageSlug(); |
146 | 146 | $_sTabSlug = $this->oProp->getCurrentTabSlug(); |
@@ -151,11 +151,11 @@ discard block |
||
151 | 151 | array( |
152 | 152 | $this->getAOrB( |
153 | 153 | $_sTabSlug, |
154 | - 'footer_left_' . $_sPageSlug . '_' . $_sTabSlug, |
|
154 | + 'footer_left_'.$_sPageSlug.'_'.$_sTabSlug, |
|
155 | 155 | null // will be ignored |
156 | 156 | ), |
157 | - 'footer_left_' . $_sPageSlug, |
|
158 | - 'footer_left_' . $this->oProp->sClassName |
|
157 | + 'footer_left_'.$_sPageSlug, |
|
158 | + 'footer_left_'.$this->oProp->sClassName |
|
159 | 159 | ), |
160 | 160 | $sLinkHTML |
161 | 161 | ); |
@@ -169,9 +169,9 @@ discard block |
||
169 | 169 | * @return string |
170 | 170 | * @internal |
171 | 171 | */ |
172 | - public function _replyToAddInfoInFooterRight( $sLinkHTML='' ) { |
|
172 | + public function _replyToAddInfoInFooterRight( $sLinkHTML = '' ) { |
|
173 | 173 | |
174 | - if ( ! $this->_isPageAdded() ) { |
|
174 | + if ( !$this->_isPageAdded() ) { |
|
175 | 175 | return $sLinkHTML; // $sLinkTHML is given by the hook. |
176 | 176 | } |
177 | 177 | |
@@ -184,13 +184,13 @@ discard block |
||
184 | 184 | array( |
185 | 185 | $this->getAOrB( |
186 | 186 | $_sTabSlug, |
187 | - 'footer_right_' . $_sPageSlug . '_' . $_sTabSlug, |
|
187 | + 'footer_right_'.$_sPageSlug.'_'.$_sTabSlug, |
|
188 | 188 | null // will be ignored |
189 | 189 | ), |
190 | - 'footer_right_' . $_sPageSlug, |
|
191 | - 'footer_right_' . $this->oProp->sClassName |
|
190 | + 'footer_right_'.$_sPageSlug, |
|
191 | + 'footer_right_'.$this->oProp->sClassName |
|
192 | 192 | ), |
193 | - $this->oProp->aFooterInfo['sRight'] |
|
193 | + $this->oProp->aFooterInfo[ 'sRight' ] |
|
194 | 194 | ); |
195 | 195 | |
196 | 196 | } |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | */ |
204 | 204 | private function _isPageAdded() { |
205 | 205 | |
206 | - if ( ! isset( $_GET[ 'page' ] ) ) { |
|
206 | + if ( !isset( $_GET[ 'page' ] ) ) { |
|
207 | 207 | return false; |
208 | 208 | } |
209 | 209 | return ( bool ) $this->oProp->isPageAdded( $_GET[ 'page' ] ); |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | : $this->oProp->sLabelPluginSettingsLink; |
229 | 229 | |
230 | 230 | // If the user disables the settings link, the label property is empty. If so, do not add it. |
231 | - if ( ! $this->oProp->sLabelPluginSettingsLink ) { |
|
231 | + if ( !$this->oProp->sLabelPluginSettingsLink ) { |
|
232 | 232 | return $aLinks; |
233 | 233 | } |
234 | 234 | |
@@ -246,13 +246,13 @@ discard block |
||
246 | 246 | array_unshift( |
247 | 247 | $aLinks, |
248 | 248 | // '<a href="' . esc_url( $_sLinkURL ) . '">' |
249 | - '<a ' . $this->getAttributes( |
|
249 | + '<a '.$this->getAttributes( |
|
250 | 250 | array( |
251 | 251 | 'href' => esc_url( $_sLinkURL ), |
252 | 252 | // 3.5.7+ Added for acceptance testing |
253 | 253 | 'class' => 'apf-plugin-title-action-link apf-post-type', |
254 | 254 | ) |
255 | - ) . '>' |
|
255 | + ).'>' |
|
256 | 256 | . $this->oProp->sLabelPluginSettingsLink |
257 | 257 | . '</a>' |
258 | 258 | ); |
@@ -275,16 +275,16 @@ discard block |
||
275 | 275 | |
276 | 276 | // Backward compatibility sanitisation. |
277 | 277 | $_aAddingLinks = array(); |
278 | - foreach( array_filter( $this->oProp->aPluginDescriptionLinks ) as $_sLLinkHTML ) { |
|
278 | + foreach ( array_filter( $this->oProp->aPluginDescriptionLinks ) as $_sLLinkHTML ) { |
|
279 | 279 | |
280 | - if ( ! $_sLLinkHTML ) { |
|
280 | + if ( !$_sLLinkHTML ) { |
|
281 | 281 | continue; |
282 | 282 | } |
283 | 283 | if ( is_array( $_sLLinkHTML ) ) { // should not be an array |
284 | 284 | $_aAddingLinks = array_merge( $_sLLinkHTML, $_aAddingLinks ); |
285 | 285 | continue; |
286 | 286 | } |
287 | - $_aAddingLinks[] = ( string ) $_sLLinkHTML; |
|
287 | + $_aAddingLinks[ ] = ( string ) $_sLLinkHTML; |
|
288 | 288 | |
289 | 289 | } |
290 | 290 | return array_merge( $aLinks, $_aAddingLinks ); |
@@ -301,13 +301,13 @@ discard block |
||
301 | 301 | public function _replyToAddPluginActionLinks( $aLinks ) { |
302 | 302 | |
303 | 303 | $_aAddingLinks = array(); |
304 | - foreach( array_filter( $this->oProp->aPluginTitleLinks ) as $_sLinkHTML ) { |
|
304 | + foreach ( array_filter( $this->oProp->aPluginTitleLinks ) as $_sLinkHTML ) { |
|
305 | 305 | |
306 | 306 | if ( is_array( $_sLinkHTML ) ) { |
307 | 307 | $_aAddingLinks = array_merge( $_sLinkHTML, $aAddingLinks ); |
308 | 308 | continue; |
309 | 309 | } |
310 | - $_aAddingLinks[] = ( string ) $_sLinkHTML; |
|
310 | + $_aAddingLinks[ ] = ( string ) $_sLinkHTML; |
|
311 | 311 | |
312 | 312 | } |
313 | 313 | return array_merge( $aLinks, $_aAddingLinks ); |