@@ -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; |
@@ -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', |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | /** |
| 124 | 124 | * Deletes the option from the database. |
| 125 | 125 | */ |
| 126 | - public function delete() { |
|
| 126 | + public function delete() { |
|
| 127 | 127 | return $this->bIsNetworkAdmin |
| 128 | 128 | ? delete_site_option( $this->sOptionKey ) |
| 129 | 129 | : delete_option( $this->sOptionKey ); |