@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | * |
| 37 | 37 | * @since 3.3.0 |
| 38 | 38 | */ |
| 39 | - public function __construct( $oMsg=null ) { |
|
| 39 | + public function __construct( $oMsg = null ) { |
|
| 40 | 40 | |
| 41 | 41 | $_sClassName = get_class( $this ); |
| 42 | 42 | if ( in_array( $_sClassName, self::$_aEnqueued ) ) { |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | */ |
| 75 | 75 | public function _replyToPrintScript() { |
| 76 | 76 | $_sScript = $this->getScript( $this->oMsg ); |
| 77 | - if ( ! $_sScript ) { |
|
| 77 | + if ( !$_sScript ) { |
|
| 78 | 78 | return; |
| 79 | 79 | } |
| 80 | - echo "<script type='text/javascript' class='" . strtolower( get_class( $this ) ) . "'>" |
|
| 80 | + echo "<script type='text/javascript' class='".strtolower( get_class( $this ) )."'>" |
|
| 81 | 81 | . $_sScript |
| 82 | 82 | . "</script>"; |
| 83 | 83 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | * @since 3.7.9 Added the second parameter to accept an action hook name. |
| 28 | 28 | */ |
| 29 | 29 | |
| 30 | - public function __construct( $oFactory, $sActionHookName='admin_notices' ) { |
|
| 30 | + public function __construct( $oFactory, $sActionHookName = 'admin_notices' ) { |
|
| 31 | 31 | |
| 32 | 32 | $this->oFactory = $oFactory; |
| 33 | 33 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | */ |
| 47 | 47 | public function _replyToPrintSettingNotice() { |
| 48 | 48 | |
| 49 | - if ( ! $this->_shouldProceed() ) { |
|
| 49 | + if ( !$this->_shouldProceed() ) { |
|
| 50 | 50 | return; |
| 51 | 51 | } |
| 52 | 52 | $this->oFactory->oForm->printSubmitNotices(); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | private function _shouldProceed() { |
| 62 | 62 | |
| 63 | - if ( ! $this->oFactory->_isInThePage() ) { |
|
| 63 | + if ( !$this->oFactory->_isInThePage() ) { |
|
| 64 | 64 | return false; |
| 65 | 65 | } |
| 66 | 66 | |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | */ |
| 61 | 61 | private function _shouldProceed() { |
| 62 | 62 | |
| 63 | - if ( ! $this->oFactory->_isInThePage() ) { |
|
| 63 | + if ( ! $this->oFactory->_isInThePage() ) { |
|
| 64 | 64 | return false; |
| 65 | 65 | } |
| 66 | 66 | |
@@ -107,8 +107,8 @@ |
||
| 107 | 107 | } |
| 108 | 108 | CSSRULES; |
| 109 | 109 | |
| 110 | - return $_sCSS . PHP_EOL |
|
| 111 | - . self::_getPageLoadStatsRules() . PHP_EOL |
|
| 110 | + return $_sCSS.PHP_EOL |
|
| 111 | + . self::_getPageLoadStatsRules().PHP_EOL |
|
| 112 | 112 | . self::_getVersionSpecificRules(); |
| 113 | 113 | |
| 114 | 114 | } |
@@ -84,7 +84,7 @@ |
||
| 84 | 84 | |
| 85 | 85 | // The first element is the option key; the section or field dimensional keys follow. |
| 86 | 86 | if ( '__dummy_option_key' === $_aDimensionalKeys[ 0 ] ) { |
| 87 | - array_shift( $_aDimensionalKeys ); |
|
| 87 | + array_shift( $_aDimensionalKeys ); |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | $this->unsetDimensionalArrayElement( |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | * @param string $sStructureType The type of object. Currently 'post_meta_box' or 'user_meta' is accepted. |
| 32 | 32 | * @return void |
| 33 | 33 | */ |
| 34 | - public function updateMetaDataByType( $iObjectID, array $aInput, array $aSavedMeta, $sStructureType='post_meta_box' ) { |
|
| 34 | + public function updateMetaDataByType( $iObjectID, array $aInput, array $aSavedMeta, $sStructureType = 'post_meta_box' ) { |
|
| 35 | 35 | |
| 36 | - if ( ! $iObjectID ) { |
|
| 36 | + if ( !$iObjectID ) { |
|
| 37 | 37 | return; |
| 38 | 38 | } |
| 39 | 39 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | 'post_meta_box' => 'update_post_meta', |
| 42 | 42 | 'user_meta' => 'update_user_meta', |
| 43 | 43 | ); |
| 44 | - if ( ! in_array( $sStructureType, array_keys( $_aFunctionNameMapByFieldsType ) ) ) { |
|
| 44 | + if ( !in_array( $sStructureType, array_keys( $_aFunctionNameMapByFieldsType ) ) ) { |
|
| 45 | 45 | return; |
| 46 | 46 | } |
| 47 | 47 | $_sFunctionName = $this->getElement( $_aFunctionNameMapByFieldsType, $sStructureType ); |
@@ -69,16 +69,16 @@ discard block |
||
| 69 | 69 | */ |
| 70 | 70 | private function _getInputByUnset( array $aInput ) { |
| 71 | 71 | |
| 72 | - $_sUnsetKey = '__unset_' . $this->sStructureType; |
|
| 73 | - if ( ! isset( $_POST[ $_sUnsetKey ] ) ) { |
|
| 72 | + $_sUnsetKey = '__unset_'.$this->sStructureType; |
|
| 73 | + if ( !isset( $_POST[ $_sUnsetKey ] ) ) { |
|
| 74 | 74 | return $aInput; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | $_aUnsetElements = array_unique( $_POST[ $_sUnsetKey ] ); |
| 78 | - foreach( $_aUnsetElements as $_sFlatInputName ) { |
|
| 78 | + foreach ( $_aUnsetElements as $_sFlatInputName ) { |
|
| 79 | 79 | |
| 80 | 80 | $_aDimensionalKeys = explode( '|', $_sFlatInputName ); |
| 81 | - if ( ! isset( $_aDimensionalKeys[ 0 ] ) ) { |
|
| 81 | + if ( !isset( $_aDimensionalKeys[ 0 ] ) ) { |
|
| 82 | 82 | continue; |
| 83 | 83 | } |
| 84 | 84 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | |
| 114 | 114 | $_vSavedValue = $this->getElement( |
| 115 | 115 | $aSavedMeta, // subject |
| 116 | - $_sSectionOrFieldID, // dimensional keys |
|
| 116 | + $_sSectionOrFieldID, // dimensional keys |
|
| 117 | 117 | null // default value |
| 118 | 118 | ); |
| 119 | 119 | |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | */ |
| 108 | 108 | private function _updateMetaDatumByFuncitonName( $iObjectID, $_vValue, array $aSavedMeta, $_sSectionOrFieldID, $_sFunctionName ) { |
| 109 | 109 | |
| 110 | - if ( is_null( $_vValue ) ) { |
|
| 110 | + if ( is_null( $_vValue ) ) { |
|
| 111 | 111 | return; |
| 112 | 112 | } |
| 113 | 113 | |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | |
| 120 | 120 | // PHP can compare even array contents with the == operator. See http://www.php.net/manual/en/language.operators.array.php |
| 121 | 121 | // if the input value and the saved meta value are the same, no need to update it. |
| 122 | - if ( $_vValue == $_vSavedValue ) { |
|
| 122 | + if ( $_vValue == $_vSavedValue ) { |
|
| 123 | 123 | return; |
| 124 | 124 | } |
| 125 | 125 | |
@@ -57,25 +57,25 @@ |
||
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | // If the section ID is not registered, return false. |
| 60 | - if ( ! array_key_exists( $sID, $this->aSectionsets ) ) { |
|
| 60 | + if ( ! array_key_exists( $sID, $this->aSectionsets ) ) { |
|
| 61 | 61 | return false; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | // the fields array's first dimension is also filled with the keys of section ids. |
| 65 | - if ( ! array_key_exists( $sID, $this->aFieldsets ) ) { |
|
| 65 | + if ( ! array_key_exists( $sID, $this->aFieldsets ) ) { |
|
| 66 | 66 | return false; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | // Since numeric IDs are denied at the beginning of the method, the elements will not be sub-sections. |
| 70 | 70 | $_bIsSeciton = false; |
| 71 | - foreach( $this->aFieldsets as $_sSectionID => $_aFields ) { |
|
| 71 | + foreach( $this->aFieldsets as $_sSectionID => $_aFields ) { |
|
| 72 | 72 | |
| 73 | - if ( $_sSectionID == $sID ) { |
|
| 73 | + if ( $_sSectionID == $sID ) { |
|
| 74 | 74 | $_bIsSeciton = true; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | // a field using the ID is found, and it precedes a section match. |
| 78 | - if ( array_key_exists( $sID, $_aFields ) ) { |
|
| 78 | + if ( array_key_exists( $sID, $_aFields ) ) { |
|
| 79 | 79 | return false; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -60,18 +60,18 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | // If the section ID is not registered, return false. |
| 63 | - if ( ! array_key_exists( $sID, $this->aSectionsets ) ) { |
|
| 63 | + if ( !array_key_exists( $sID, $this->aSectionsets ) ) { |
|
| 64 | 64 | return false; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | // the fields array's first dimension is also filled with the keys of section ids. |
| 68 | - if ( ! array_key_exists( $sID, $this->aFieldsets ) ) { |
|
| 68 | + if ( !array_key_exists( $sID, $this->aFieldsets ) ) { |
|
| 69 | 69 | return false; |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | // Since numeric IDs are denied at the beginning of the method, the elements will not be sub-sections. |
| 73 | 73 | $_bIsSeciton = false; |
| 74 | - foreach( $this->aFieldsets as $_sSectionID => $_aFields ) { |
|
| 74 | + foreach ( $this->aFieldsets as $_sSectionID => $_aFields ) { |
|
| 75 | 75 | |
| 76 | 76 | if ( $_sSectionID == $sID ) { |
| 77 | 77 | $_bIsSeciton = true; |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | */ |
| 99 | 99 | public function canUserView( $sCapability ) { |
| 100 | 100 | |
| 101 | - if ( ! $sCapability ) { |
|
| 101 | + if ( !$sCapability ) { |
|
| 102 | 102 | return true; |
| 103 | 103 | } |
| 104 | 104 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $aOptions // data source |
| 69 | 69 | ); |
| 70 | 70 | |
| 71 | - foreach( $aOptions as $_sSectionID => $_aSubSectionOrFields ) { |
|
| 71 | + foreach ( $aOptions as $_sSectionID => $_aSubSectionOrFields ) { |
|
| 72 | 72 | |
| 73 | 73 | $_aSubSection = $this->_getSubSectionFromOptions( |
| 74 | 74 | $_sSectionID, |
@@ -105,10 +105,10 @@ discard block |
||
| 105 | 105 | |
| 106 | 106 | $_aSubSection = array(); |
| 107 | 107 | $_iPrevIndex = null; |
| 108 | - foreach( $_aSubSectionOrFields as $_isIndexOrFieldID => $_aSubSectionOrFieldOptions ) { |
|
| 108 | + foreach ( $_aSubSectionOrFields as $_isIndexOrFieldID => $_aSubSectionOrFieldOptions ) { |
|
| 109 | 109 | |
| 110 | 110 | // If it is not a sub-section array, skip. |
| 111 | - if ( ! $this->isNumericInteger( $_isIndexOrFieldID ) ) { |
|
| 111 | + if ( !$this->isNumericInteger( $_isIndexOrFieldID ) ) { |
|
| 112 | 112 | continue; |
| 113 | 113 | } |
| 114 | 114 | |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | ); |
| 123 | 123 | |
| 124 | 124 | // Update the internal section index key |
| 125 | - foreach( $_aSubSection[ $_iIndex ] as &$_aField ) { |
|
| 125 | + foreach ( $_aSubSection[ $_iIndex ] as &$_aField ) { |
|
| 126 | 126 | $_aField[ '_section_index' ] = $_iIndex; |
| 127 | 127 | } |
| 128 | 128 | unset( $_aField ); // to be safe in PHP |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | */ |
| 148 | 148 | private function _getSubSectionItemsFromOptions( array $_aSubSection, $_sSectionID, $_iIndex, $_iPrevIndex ) { |
| 149 | 149 | |
| 150 | - if ( ! isset( $this->aFieldsets[ $_sSectionID ] ) ) { |
|
| 150 | + if ( !isset( $this->aFieldsets[ $_sSectionID ] ) ) { |
|
| 151 | 151 | return array(); |
| 152 | 152 | } |
| 153 | 153 | |
@@ -156,7 +156,7 @@ discard block |
||
| 156 | 156 | : $this->getNonIntegerKeyElements( $this->aFieldsets[ $_sSectionID ] ); |
| 157 | 157 | |
| 158 | 158 | // if empty, merge with the previous element. |
| 159 | - return ! empty( $_aFields ) |
|
| 159 | + return !empty( $_aFields ) |
|
| 160 | 160 | ? $_aFields |
| 161 | 161 | : $this->getElementAsArray( |
| 162 | 162 | $_aSubSection, |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | foreach( $_aSubSectionOrFields as $_isIndexOrFieldID => $_aSubSectionOrFieldOptions ) { |
| 109 | 109 | |
| 110 | 110 | // If it is not a sub-section array, skip. |
| 111 | - if ( ! $this->isNumericInteger( $_isIndexOrFieldID ) ) { |
|
| 111 | + if ( ! $this->isNumericInteger( $_isIndexOrFieldID ) ) { |
|
| 112 | 112 | continue; |
| 113 | 113 | } |
| 114 | 114 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | /** |
| 44 | 44 | * Stores the section definition. |
| 45 | 45 | */ |
| 46 | - public $aSection = array(); |
|
| 46 | + public $aSection = array(); |
|
| 47 | 47 | |
| 48 | 48 | /** |
| 49 | 49 | * Indicates the sub section index. |
@@ -91,8 +91,8 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | $_aSection[ '_is_collapsible' ] = $_aSection[ 'collapsible' ] && 'section' === $_aSection[ 'collapsible' ][ 'container' ]; |
| 93 | 93 | |
| 94 | - $_aSection[ '_tag_id' ] = 'section-' . $_aSection[ 'section_id' ] . '__' . $this->iIndex; |
|
| 95 | - $_aSection[ '_tag_id_model' ] = 'section-' . $_aSection[ 'section_id' ] . '__' . '___i___'; |
|
| 94 | + $_aSection[ '_tag_id' ] = 'section-'.$_aSection[ 'section_id' ].'__'.$this->iIndex; |
|
| 95 | + $_aSection[ '_tag_id_model' ] = 'section-'.$_aSection[ 'section_id' ].'__'.'___i___'; |
|
| 96 | 96 | |
| 97 | 97 | return $_aSection; |
| 98 | 98 | |
@@ -239,7 +239,7 @@ |
||
| 239 | 239 | * @since 3.6.0 Moved from `AdminPageFramework_FieldDefinition`. |
| 240 | 240 | * @since DEVVER Changed the `_field_type` element to `_structure_type`. |
| 241 | 241 | */ |
| 242 | - private function _getStoredInputFieldValue( $aField, $aOptions ) { |
|
| 242 | + private function _getStoredInputFieldValue( $aField, $aOptions ) { |
|
| 243 | 243 | |
| 244 | 244 | // If a section is not set, check the first dimension element. |
| 245 | 245 | if ( ! isset( $aField[ 'section_id' ] ) || '_default' === $aField[ 'section_id' ] ) { |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | public function get() { |
| 57 | 57 | |
| 58 | 58 | // Get the set value(s) |
| 59 | - $_mSavedValue = $this->_getStoredInputFieldValue( |
|
| 59 | + $_mSavedValue = $this->_getStoredInputFieldValue( |
|
| 60 | 60 | $this->aField, |
| 61 | 61 | $this->aOptions |
| 62 | 62 | ); |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | * @return void |
| 117 | 117 | */ |
| 118 | 118 | private function _divideMainAndSubFields( array $aField, array &$aFirstField, array &$aSubFields ) { |
| 119 | - foreach( $aField as $_nsIndex => $_mFieldElement ) { |
|
| 119 | + foreach ( $aField as $_nsIndex => $_mFieldElement ) { |
|
| 120 | 120 | if ( is_numeric( $_nsIndex ) ) { |
| 121 | - $aSubFields[] = $_mFieldElement; |
|
| 121 | + $aSubFields[ ] = $_mFieldElement; |
|
| 122 | 122 | } else { |
| 123 | 123 | $aFirstField[ $_nsIndex ] = $_mFieldElement; |
| 124 | 124 | } |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | * @return void |
| 137 | 137 | */ |
| 138 | 138 | private function _fillRepeatableElements( array $aField, array &$aSubFields, $mSavedValue ) { |
| 139 | - if ( ! $aField[ 'repeatable' ] ) { |
|
| 139 | + if ( !$aField[ 'repeatable' ] ) { |
|
| 140 | 140 | return; |
| 141 | 141 | } |
| 142 | 142 | $_aSavedValues = ( array ) $mSavedValue; |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | // We are collecting elements from the second sub-field. |
| 145 | 145 | unset( $_aSavedValues[ 0 ] ); |
| 146 | 146 | |
| 147 | - foreach( $_aSavedValues as $_iIndex => $vValue ) { |
|
| 147 | + foreach ( $_aSavedValues as $_iIndex => $vValue ) { |
|
| 148 | 148 | $aSubFields[ $_iIndex - 1 ] = isset( $aSubFields[ $_iIndex - 1 ] ) && is_array( $aSubFields[ $_iIndex - 1 ] ) |
| 149 | 149 | ? $aSubFields[ $_iIndex - 1 ] |
| 150 | 150 | : array(); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | private function _fillSubFields( array &$aSubFields, array $aFirstField ) { |
| 161 | 161 | |
| 162 | - foreach( $aSubFields as &$_aSubField ) { |
|
| 162 | + foreach ( $aSubFields as &$_aSubField ) { |
|
| 163 | 163 | |
| 164 | 164 | // Evacuate the label element which should not be merged. |
| 165 | 165 | $_aLabel = $this->getElement( |
@@ -190,15 +190,15 @@ discard block |
||
| 190 | 190 | |
| 191 | 191 | // Determine whether the elements are saved in an array. |
| 192 | 192 | // $_bHasSubFields = count( $aFields ) > 1 || $aField[ 'repeatable' ] || $aField[ 'sortable' ]; |
| 193 | - if ( ! $this->hasSubFields( $aFields, $aField ) ) { |
|
| 193 | + if ( !$this->hasSubFields( $aFields, $aField ) ) { |
|
| 194 | 194 | $aFields[ 0 ][ '_saved_value' ] = $mSavedValue; |
| 195 | 195 | $aFields[ 0 ][ '_is_multiple_fields' ] = false; |
| 196 | 196 | return; |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | - foreach( $aFields as $_iIndex => &$_aThisField ) { |
|
| 199 | + foreach ( $aFields as $_iIndex => &$_aThisField ) { |
|
| 200 | 200 | $_aThisField[ '_saved_value' ] = $this->getElement( $mSavedValue, $_iIndex, null ); |
| 201 | - $_aThisField[ '_subfield_index' ] = $_iIndex; // 3.8.0+ |
|
| 201 | + $_aThisField[ '_subfield_index' ] = $_iIndex; // 3.8.0+ |
|
| 202 | 202 | $_aThisField[ '_is_multiple_fields' ] = true; |
| 203 | 203 | } |
| 204 | 204 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | * @since 3.6.0 Moved from `AdminPageFramework_FieldDefinition`. |
| 213 | 213 | */ |
| 214 | 214 | private function _setFieldsValue( array &$aFields ) { |
| 215 | - foreach( $aFields as &$_aField ) { |
|
| 215 | + foreach ( $aFields as &$_aField ) { |
|
| 216 | 216 | $_aField[ '_is_value_set_by_user' ] = isset( $_aField[ 'value' ] ); |
| 217 | 217 | $_aField[ 'value' ] = $this->_getSetFieldValue( $_aField ); |
| 218 | 218 | } |
@@ -257,10 +257,10 @@ discard block |
||
| 257 | 257 | */ |
| 258 | 258 | private function _getStoredInputFieldValue( $aField, $aOptions ) { |
| 259 | 259 | |
| 260 | - $_aFieldPath = $aField[ '_field_path_array' ]; |
|
| 260 | + $_aFieldPath = $aField[ '_field_path_array' ]; |
|
| 261 | 261 | |
| 262 | 262 | // If a section is not set, check the first dimension element. |
| 263 | - if ( ! isset( $aField[ 'section_id' ] ) || '_default' === $aField[ 'section_id' ] ) { |
|
| 263 | + if ( !isset( $aField[ 'section_id' ] ) || '_default' === $aField[ 'section_id' ] ) { |
|
| 264 | 264 | return $this->getElement( |
| 265 | 265 | $aOptions, |
| 266 | 266 | $_aFieldPath, // $aField[ 'field_id' ], // @todo this may have to be a field path instead of field id. |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | foreach( $aSectionsetsToParse as $_sSectionPath => $_aSectionset ) { |
| 85 | 85 | |
| 86 | 86 | // The '_default' section can be empty so do not check `if ( empty( $_aSectionset ) )` here. |
| 87 | - if ( ! is_array( $_aSectionset ) ) { |
|
| 87 | + if ( ! is_array( $_aSectionset ) ) { |
|
| 88 | 88 | continue; |
| 89 | 89 | } |
| 90 | 90 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $this->aCallbacks[ 'sectionset_before_output' ], |
| 104 | 104 | array( $_aSectionsetFormatter->get() ) |
| 105 | 105 | ); |
| 106 | - if ( empty( $_aSectionset ) ) { |
|
| 106 | + if ( empty( $_aSectionset ) ) { |
|
| 107 | 107 | continue; |
| 108 | 108 | } |
| 109 | 109 | |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | $_aSectionsets = $this->_getSectionsetsFormatted( |
| 67 | - array(), // section-sets array to modify - new formatted items will be stored here |
|
| 68 | - $this->aSectionsets, // parsing section-sets |
|
| 69 | - array(), // section path - empty for root |
|
| 67 | + array(), // section-sets array to modify - new formatted items will be stored here |
|
| 68 | + $this->aSectionsets, // parsing section-sets |
|
| 69 | + array(), // section path - empty for root |
|
| 70 | 70 | $this->sCapability // capability |
| 71 | 71 | ); |
| 72 | 72 | |
@@ -83,10 +83,10 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | private function _getSectionsetsFormatted( $_aNewSectionsets, $aSectionsetsToParse, $aSectionPath, $sCapability ) { |
| 85 | 85 | |
| 86 | - foreach( $aSectionsetsToParse as $_sSectionPath => $_aSectionset ) { |
|
| 86 | + foreach ( $aSectionsetsToParse as $_sSectionPath => $_aSectionset ) { |
|
| 87 | 87 | |
| 88 | 88 | // The '_default' section can be empty so do not check `if ( empty( $_aSectionset ) )` here. |
| 89 | - if ( ! is_array( $_aSectionset ) ) { |
|
| 89 | + if ( !is_array( $_aSectionset ) ) { |
|
| 90 | 90 | continue; |
| 91 | 91 | } |
| 92 | 92 | |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | // 3.7.0+ For nested sections |
| 119 | 119 | $_aNewSectionsets = $this->_getNestedSections( |
| 120 | - $_aNewSectionsets, // sectionset array to modify |
|
| 120 | + $_aNewSectionsets, // sectionset array to modify |
|
| 121 | 121 | $_aSectionset, |
| 122 | 122 | $_aSectionPath, // section path |
| 123 | 123 | $_aSectionset[ 'capability' ] |
@@ -134,15 +134,15 @@ discard block |
||
| 134 | 134 | */ |
| 135 | 135 | private function _getNestedSections( $aSectionsetsToEdit, $aSectionset, $aSectionPath, $sCapability ) { |
| 136 | 136 | |
| 137 | - if ( ! $this->_hasNestedSections( $aSectionset ) ) { |
|
| 137 | + if ( !$this->_hasNestedSections( $aSectionset ) ) { |
|
| 138 | 138 | return $aSectionsetsToEdit; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | // Recursive call |
| 142 | 142 | return $this->_getSectionsetsFormatted( |
| 143 | - $aSectionsetsToEdit, // section-sets array to modify - new formatted items will be stored here |
|
| 144 | - $aSectionset[ 'content' ], // parsing section-sets |
|
| 145 | - $aSectionPath, // section path - empty for root |
|
| 143 | + $aSectionsetsToEdit, // section-sets array to modify - new formatted items will be stored here |
|
| 144 | + $aSectionset[ 'content' ], // parsing section-sets |
|
| 145 | + $aSectionPath, // section path - empty for root |
|
| 146 | 146 | $sCapability // capability |
| 147 | 147 | ); |
| 148 | 148 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | private function _hasNestedSections( $aSectionset ) { |
| 156 | 156 | |
| 157 | 157 | $aSectionset = $aSectionset + array( 'content' => null ); |
| 158 | - if ( ! is_array( $aSectionset[ 'content' ] ) ) { |
|
| 158 | + if ( !is_array( $aSectionset[ 'content' ] ) ) { |
|
| 159 | 159 | return false; |
| 160 | 160 | } |
| 161 | 161 | $_aContents = $aSectionset[ 'content' ]; |