@@ -56,7 +56,7 @@ |
||
56 | 56 | * @param string $sCapability (optional) sets the overall access level to the admin pages created by the framework. The used capabilities are listed <a href="http://codex.wordpress.org/Roles_and_Capabilities">here</a>. The capability can be set per page, tab, setting section, setting field. Default: `manage_options` |
57 | 57 | * @param string $sTextDomain (optional) the <a href="http://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains" target="_blank">text domain</a> used for the framework's system messages. Default: admin-page-framework. |
58 | 58 | */ |
59 | - public function __construct( $isOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ){ |
|
59 | + public function __construct( $isOptionKey=null, $sCallerPath=null, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
60 | 60 | |
61 | 61 | if ( ! $this->_isInstantiatable() ) { |
62 | 62 | return; |
@@ -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 | |
@@ -181,14 +181,15 @@ discard block |
||
181 | 181 | $_POST[ 'admin_page_framework_start' ], // indicates the framework form is started |
182 | 182 | $_POST[ '_wp_http_referer' ] |
183 | 183 | ) |
184 | - ) { |
|
184 | + ) { |
|
185 | 185 | return false; |
186 | 186 | } |
187 | 187 | |
188 | 188 | // Referrer |
189 | 189 | $_sRequestURI = remove_query_arg( array( 'settings-updated', 'confirmation', 'field_errors' ), wp_unslash( $_SERVER[ 'REQUEST_URI' ] ) ); |
190 | 190 | $_sReffererURI = remove_query_arg( array( 'settings-updated', 'confirmation', 'field_errors' ), $_POST[ '_wp_http_referer' ] ); |
191 | - if ( $_sRequestURI != $_sReffererURI ) { // see the function definition of wp_referer_field() in functions.php. |
|
191 | + if ( $_sRequestURI != $_sReffererURI ) { |
|
192 | +// see the function definition of wp_referer_field() in functions.php. |
|
192 | 193 | return false; |
193 | 194 | } |
194 | 195 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @return null|string Returns `null` if no value is found and the associated link url if found. |
47 | 47 | * Otherwise, the found value. |
48 | 48 | */ |
49 | - protected function _getPressedSubmitButtonData( array $aPostElements, $sTargetKey='field_id' ) { |
|
49 | + protected function _getPressedSubmitButtonData( array $aPostElements, $sTargetKey='field_id' ) { |
|
50 | 50 | |
51 | 51 | foreach( $aPostElements as $_sInputID => $_aSubElements ) { |
52 | 52 | |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | protected function _setSettingNoticeAfterValidation( $bIsInputEmtpy ) { |
86 | 86 | |
87 | - if ( $this->oFactory->hasSettingNotice() ) { |
|
87 | + if ( $this->oFactory->hasSettingNotice() ) { |
|
88 | 88 | return; |
89 | 89 | } |
90 | 90 | $this->oFactory->setSettingNotice( |
@@ -181,7 +181,8 @@ discard block |
||
181 | 181 | */ |
182 | 182 | private function _validateEachField( array $aData, array $aInputsToParse ) { |
183 | 183 | |
184 | - foreach( $aInputsToParse as $_sID => $_aSectionOrFields ) { // $_sID is either a section id or a field id |
|
184 | + foreach( $aInputsToParse as $_sID => $_aSectionOrFields ) { |
|
185 | +// $_sID is either a section id or a field id |
|
185 | 186 | |
186 | 187 | // For each section |
187 | 188 | if ( $this->oFactory->oForm->isSection( $_sID ) ) { |
@@ -192,7 +193,8 @@ discard block |
||
192 | 193 | } |
193 | 194 | |
194 | 195 | // Call the validation callback method. |
195 | - foreach( $_aSectionOrFields as $_sFieldID => $_aFields ) { // For fields |
|
196 | + foreach( $_aSectionOrFields as $_sFieldID => $_aFields ) { |
|
197 | +// For fields |
|
196 | 198 | $aData[ 'aInput' ][ $_sID ][ $_sFieldID ] = $this->_getValidatedData( |
197 | 199 | "validation_{$this->oFactory->oProp->sClassName}_{$_sID}_{$_sFieldID}", |
198 | 200 | $aData[ 'aInput' ][ $_sID ][ $_sFieldID ], |
@@ -276,7 +278,7 @@ discard block |
||
276 | 278 | */ |
277 | 279 | private function _validateTabFields( array $aData ) { |
278 | 280 | |
279 | - if ( ! $aData[ 'sTabSlug' ] || ! $aData[ 'sPageSlug' ] ) { |
|
281 | + if ( ! $aData[ 'sTabSlug' ] || ! $aData[ 'sPageSlug' ] ) { |
|
280 | 282 | return $aData; |
281 | 283 | } |
282 | 284 | |
@@ -337,7 +339,7 @@ discard block |
||
337 | 339 | */ |
338 | 340 | private function _validatePageFields( array $aData ) { |
339 | 341 | |
340 | - if ( ! $aData[ 'sPageSlug' ] ) { |
|
342 | + if ( ! $aData[ 'sPageSlug' ] ) { |
|
341 | 343 | return $aData[ 'aInput' ]; |
342 | 344 | } |
343 | 345 |
@@ -55,7 +55,7 @@ |
||
55 | 55 | * @param string $sTextDomain (optional) the <a href="http://codex.wordpress.org/I18n_for_WordPress_Developers#Text_Domains" target="_blank">text domain</a> used for the framework's system messages. Default: `admin-page-framework`. |
56 | 56 | * @return void returns nothing. |
57 | 57 | */ |
58 | - public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_network', $sTextDomain='admin-page-framework' ){ |
|
58 | + public function __construct( $sOptionKey=null, $sCallerPath=null, $sCapability='manage_network', $sTextDomain='admin-page-framework' ) { |
|
59 | 59 | |
60 | 60 | if ( ! $this->_isInstantiatable() ) { |
61 | 61 | return; |
@@ -226,8 +226,9 @@ |
||
226 | 226 | |
227 | 227 | $_aContributors = json_decode( wp_remote_retrieve_body( $_mResponse ) ); |
228 | 228 | |
229 | - if ( ! is_array( $_aContributors ) ) |
|
230 | - return array(); |
|
229 | + if ( ! is_array( $_aContributors ) ) { |
|
230 | + return array(); |
|
231 | + } |
|
231 | 232 | |
232 | 233 | set_transient( 'apfl_contributors', $_aContributors, 3600 ); |
233 | 234 |
@@ -80,7 +80,7 @@ |
||
80 | 80 | return $_aNestedSections; |
81 | 81 | |
82 | 82 | } |
83 | - private function getFAQContents() { |
|
83 | + private function getFAQContents() { |
|
84 | 84 | |
85 | 85 | $_aReplacements = array( |
86 | 86 | '%PLUGIN_DIR_URL%' => AdminPageFrameworkLoader_Registry::getPluginURL(), |
@@ -45,7 +45,7 @@ |
||
45 | 45 | ); |
46 | 46 | $_oWPDB = ${ 'GLOBALS' }[ 'wpdb' ]; |
47 | 47 | foreach( $_aPrefixes as $_sPrefix ) { |
48 | - if ( ! $_sPrefix ) { |
|
48 | + if ( ! $_sPrefix ) { |
|
49 | 49 | continue; |
50 | 50 | } |
51 | 51 | $_oWPDB->query( "DELETE FROM `{$_oWPDB->prefix}options` WHERE `option_name` LIKE ( '_transient_%{$_sPrefix}%' )" ); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | // When newly installed, the 'welcomed' value is not set. |
49 | 49 | $_oOption = AdminPageFrameworkLoader_Option::getInstance(); |
50 | - if ( ! $_oOption->get( 'welcomed' ) ) { |
|
50 | + if ( ! $_oOption->get( 'welcomed' ) ) { |
|
51 | 51 | $this->_setInitialOptions( $_oOption, AdminPageFrameworkLoader_Registry::VERSION ); |
52 | 52 | $this->_goToWelcomePage(); // will exit |
53 | 53 | } |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | } |
72 | 72 | |
73 | - private function _goToWelcomePage() { |
|
73 | + private function _goToWelcomePage() { |
|
74 | 74 | |
75 | 75 | $_sWelcomePageURL = apply_filters( |
76 | 76 | AdminPageFrameworkLoader_Registry::HOOK_SLUG . '_filter_admin_welcome_redirect_url', |