@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | * For the `admin_page` fields type, an option key is prepended. |
44 | 44 | * For `page_meta_box`, no prepended element and it starts with the section or field ID. |
45 | 45 | */ |
46 | - static public function getInputsUnset( array $aInputs, $sFieldsType, $iSkipDepth=0 ) { |
|
46 | + static public function getInputsUnset( array $aInputs, $sFieldsType, $iSkipDepth = 0 ) { |
|
47 | 47 | |
48 | - $_sUnsetKey = '__unset_' . $sFieldsType; |
|
49 | - if ( ! isset( $_POST[ $_sUnsetKey ] ) ) { |
|
48 | + $_sUnsetKey = '__unset_'.$sFieldsType; |
|
49 | + if ( !isset( $_POST[ $_sUnsetKey ] ) ) { |
|
50 | 50 | return $aInputs; |
51 | 51 | } |
52 | 52 | |
53 | 53 | $_aUnsetElements = array_unique( $_POST[ $_sUnsetKey ] ); |
54 | - foreach( $_aUnsetElements as $_sFlatInputName ) { |
|
54 | + foreach ( $_aUnsetElements as $_sFlatInputName ) { |
|
55 | 55 | |
56 | 56 | $_aDimensionalKeys = explode( '|', $_sFlatInputName ); |
57 | 57 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | // The first element is the option key for the `admin_page` field type and section or field dimensional keys follow. |
64 | - for ( $_i = 0; $_i < $iSkipDepth; $_i++) { |
|
64 | + for ( $_i = 0; $_i < $iSkipDepth; $_i++ ) { |
|
65 | 65 | unset( $_aDimensionalKeys[ $_i ] ); |
66 | 66 | } |
67 | 67 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | */ |
119 | 119 | static public function hasNestedFields( $aFieldset ) { |
120 | 120 | |
121 | - if ( ! self::hasFieldDefinitionsInContent( $aFieldset ) ) { |
|
121 | + if ( !self::hasFieldDefinitionsInContent( $aFieldset ) ) { |
|
122 | 122 | return false; |
123 | 123 | } |
124 | 124 | // At this point, the `content` argument contains either the definition of nested fields or inline-mixed fields. |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | */ |
141 | 141 | static public function hasFieldDefinitionsInContent( $aFieldset ) { |
142 | 142 | |
143 | - if ( ! isset( $aFieldset[ 'content' ] ) ) { |
|
143 | + if ( !isset( $aFieldset[ 'content' ] ) ) { |
|
144 | 144 | return false; |
145 | 145 | } |
146 | 146 | if ( empty( $aFieldset[ 'content' ] ) ) { |
@@ -175,10 +175,10 @@ discard block |
||
175 | 175 | * @since 3.8.13 |
176 | 176 | */ |
177 | 177 | static public function isDynamicField( $aField ) { |
178 | - if ( ! empty( $aField[ 'repeatable' ] ) ) { |
|
178 | + if ( !empty( $aField[ 'repeatable' ] ) ) { |
|
179 | 179 | return true; |
180 | 180 | } |
181 | - if ( ! empty( $aField[ 'sortable' ] ) ) { |
|
181 | + if ( !empty( $aField[ 'sortable' ] ) ) { |
|
182 | 182 | return true; |
183 | 183 | } |
184 | 184 | return false; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | if ( empty( $sString ) ) { |
208 | 208 | return $sString; |
209 | 209 | } |
210 | - return $sString . '|'; |
|
210 | + return $sString.'|'; |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
@@ -223,17 +223,17 @@ discard block |
||
223 | 223 | */ |
224 | 224 | static public function getFieldsetReformattedBySubFieldIndex( $aFieldset, $iSubFieldIndex, $bHasSubFields, $aParentFieldset ) { |
225 | 225 | |
226 | - $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
226 | + $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
227 | 227 | |
228 | 228 | // Add sub-field index to the parent field path for repeated nested items. |
229 | - $aFieldset[ '_parent_field_path' ] = self::getAOrB( |
|
229 | + $aFieldset[ '_parent_field_path' ] = self::getAOrB( |
|
230 | 230 | $bHasSubFields, |
231 | - $aFieldset[ '_parent_field_path' ] . '|' . $iSubFieldIndex, |
|
231 | + $aFieldset[ '_parent_field_path' ].'|'.$iSubFieldIndex, |
|
232 | 232 | $aFieldset[ '_parent_field_path' ] |
233 | 233 | ); |
234 | - $aFieldset[ '_parent_tag_id' ] = self::getAOrB( |
|
234 | + $aFieldset[ '_parent_tag_id' ] = self::getAOrB( |
|
235 | 235 | $bHasSubFields, |
236 | - $aParentFieldset[ 'tag_id' ] . '__' . $iSubFieldIndex, |
|
236 | + $aParentFieldset[ 'tag_id' ].'__'.$iSubFieldIndex, |
|
237 | 237 | $aParentFieldset[ 'tag_id' ] |
238 | 238 | ); |
239 | 239 | |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | $aFieldset, |
243 | 243 | $aFieldset[ '_structure_type' ], |
244 | 244 | $aFieldset[ 'capability' ], |
245 | - ( integer ) $iSubFieldIndex + 1, // 1-based count (not index) |
|
245 | + ( integer ) $iSubFieldIndex + 1, // 1-based count (not index) |
|
246 | 246 | $aFieldset[ '_subsection_index' ], |
247 | 247 | $aFieldset[ '_is_section_repeatable' ], |
248 | 248 | $aFieldset[ '_caller_object' ] |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | |
252 | 252 | $_oFieldsetOutputFormatter = new AdminPageFramework_Form_Model___Format_FieldsetOutput( |
253 | 253 | $aFieldset, |
254 | - $aFieldset[ '_section_index' ], // `_section_index` is defined in the ...FieldsetOutput class. Since this is a nested item, it should be already set. |
|
254 | + $aFieldset[ '_section_index' ], // `_section_index` is defined in the ...FieldsetOutput class. Since this is a nested item, it should be already set. |
|
255 | 255 | $_oCallerForm->aFieldTypeDefinitions |
256 | 256 | ); |
257 | 257 | return $_oFieldsetOutputFormatter->get(); |
@@ -288,12 +288,12 @@ discard block |
||
288 | 288 | if ( empty( $aArguments ) ) { |
289 | 289 | return ''; |
290 | 290 | } |
291 | - if ( self::hasBeenCalled( 'disabled_repeatable_elements_modal_' . $sBoxElementID ) ) { |
|
291 | + if ( self::hasBeenCalled( 'disabled_repeatable_elements_modal_'.$sBoxElementID ) ) { |
|
292 | 292 | return ''; |
293 | 293 | } |
294 | 294 | add_thickbox(); // to display a message to the user. |
295 | 295 | return "<div id='{$sBoxElementID}' style='display:none'>" |
296 | - . "<p>" . $aArguments[ 'message' ] . "</p>" |
|
296 | + . "<p>".$aArguments[ 'message' ]."</p>" |
|
297 | 297 | . "</div>"; |
298 | 298 | |
299 | 299 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | |
58 | 58 | // For form sections, a dummy key is set |
59 | 59 | if ( '__dummy_option_key' === $_aDimensionalKeys[ 0 ] ) { |
60 | - array_shift( $_aDimensionalKeys ); |
|
60 | + array_shift( $_aDimensionalKeys ); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | // The first element is the option key for the `admin_page` field type and section or field dimensional keys follow. |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | } |
130 | 130 | |
131 | 131 | // If the first element is a string, it is an inline mixed field definition. |
132 | - return is_array( self::getElement( $aFieldset[ 'content' ], 0 ) ); |
|
132 | + return is_array( self::getElement( $aFieldset[ 'content' ], 0 ) ); |
|
133 | 133 | |
134 | 134 | } |
135 | 135 |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | |
76 | 76 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
77 | 77 | ? $this->aSubClassNames[ 'oProp' ] |
78 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
78 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
79 | 79 | $this->oProp = new $_sPropertyClassName( |
80 | - $this, // caller object |
|
81 | - null, // the caller script path |
|
82 | - $sThisClassName, // class name |
|
83 | - $sCapability, // capability |
|
84 | - $sTextDomain, // text domain |
|
80 | + $this, // caller object |
|
81 | + null, // the caller script path |
|
82 | + $sThisClassName, // class name |
|
83 | + $sCapability, // capability |
|
84 | + $sTextDomain, // text domain |
|
85 | 85 | $this->_sStructureType // fields type |
86 | 86 | ); |
87 | 87 | |
@@ -103,22 +103,22 @@ discard block |
||
103 | 103 | * @since 3.8.17 |
104 | 104 | */ |
105 | 105 | private function ___getConstructorParametersUsedForThisClassName( $sClassName ) { |
106 | - if ( ! isset( $GLOBALS[ 'wp_widget_factory' ] ) ) { |
|
106 | + if ( !isset( $GLOBALS[ 'wp_widget_factory' ] ) ) { |
|
107 | 107 | return array(); |
108 | 108 | } |
109 | - if ( ! is_object( $GLOBALS[ 'wp_widget_factory' ] ) ) { |
|
109 | + if ( !is_object( $GLOBALS[ 'wp_widget_factory' ] ) ) { |
|
110 | 110 | return array(); |
111 | 111 | } |
112 | - if ( ! isset( $GLOBALS[ 'wp_widget_factory' ]->widgets[ $sClassName ] ) ) { |
|
112 | + if ( !isset( $GLOBALS[ 'wp_widget_factory' ]->widgets[ $sClassName ] ) ) { |
|
113 | 113 | return array(); |
114 | 114 | } |
115 | 115 | // At this point, the widget of the given name is already registered. |
116 | 116 | $_oWPWidget = $GLOBALS[ 'wp_widget_factory' ]->widgets[ $sClassName ]; |
117 | 117 | return array( |
118 | - $_oWPWidget->oCaller->oProp->sWidgetTitle, // 1. widget title, |
|
119 | - $_oWPWidget->oCaller->oProp->aWidgetArguments, // 2. widget arguments |
|
120 | - $_oWPWidget->oCaller->oProp->sCapability, // 3. capability |
|
121 | - $_oWPWidget->oCaller->oProp->sTextDomain, // 4. text domain |
|
118 | + $_oWPWidget->oCaller->oProp->sWidgetTitle, // 1. widget title, |
|
119 | + $_oWPWidget->oCaller->oProp->aWidgetArguments, // 2. widget arguments |
|
120 | + $_oWPWidget->oCaller->oProp->sCapability, // 3. capability |
|
121 | + $_oWPWidget->oCaller->oProp->sTextDomain, // 4. text domain |
|
122 | 122 | ); |
123 | 123 | } |
124 | 124 |
@@ -27,17 +27,17 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function _replyToGetSectionName( /* $sAttribute, $aSectionset */ ) { |
29 | 29 | |
30 | - $_aParams = func_get_args() + array( null, null, ); |
|
30 | + $_aParams = func_get_args() + array( null, null,); |
|
31 | 31 | $sNameAttribute = $_aParams[ 0 ]; |
32 | 32 | $aSectionset = $_aParams[ 1 ]; |
33 | 33 | $_aSectionPath = $aSectionset[ '_section_path_array' ]; |
34 | 34 | $_aDimensionalKeys = array( $this->oProp->sOptionKey ); |
35 | - foreach( $_aSectionPath as $_sDimension ) { |
|
36 | - $_aDimensionalKeys[] = '[' . $_sDimension . ']'; |
|
35 | + foreach ( $_aSectionPath as $_sDimension ) { |
|
36 | + $_aDimensionalKeys[ ] = '['.$_sDimension.']'; |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | if ( isset( $aSectionset[ '_index' ] ) ) { |
40 | - $_aDimensionalKeys[] = '[' . $aSectionset[ '_index' ] . ']'; |
|
40 | + $_aDimensionalKeys[ ] = '['.$aSectionset[ '_index' ].']'; |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | return implode( '', $_aDimensionalKeys ); |
@@ -50,25 +50,25 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function _replyToGetFieldNameAttribute( /* $sAttribute, $aFieldset */ ) { |
52 | 52 | |
53 | - $_aParams = func_get_args() + array( null, null, ); |
|
53 | + $_aParams = func_get_args() + array( null, null,); |
|
54 | 54 | $sNameAttribute = $_aParams[ 0 ]; |
55 | 55 | $aFieldset = $_aParams[ 1 ]; |
56 | 56 | $_aDimensionalKeys = array( |
57 | 57 | $this->oProp->sOptionKey // Use `$this->oProp->sOptionKey` instead of `$aFieldset[ 'option_key' ]` which is not set for nested items. |
58 | 58 | ); |
59 | 59 | if ( $this->isSectionSet( $aFieldset ) ) { |
60 | - $_aSectionPath = $aFieldset[ '_section_path_array' ]; |
|
61 | - foreach( $_aSectionPath as $_sDimension ) { |
|
62 | - $_aDimensionalKeys[] = '[' . $_sDimension . ']'; |
|
60 | + $_aSectionPath = $aFieldset[ '_section_path_array' ]; |
|
61 | + foreach ( $_aSectionPath as $_sDimension ) { |
|
62 | + $_aDimensionalKeys[ ] = '['.$_sDimension.']'; |
|
63 | 63 | } |
64 | 64 | if ( isset( $aFieldset[ '_section_index' ] ) ) { |
65 | - $_aDimensionalKeys[] = '[' . $aFieldset[ '_section_index' ] . ']'; |
|
65 | + $_aDimensionalKeys[ ] = '['.$aFieldset[ '_section_index' ].']'; |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | |
69 | 69 | // 3.8.0+ Support for nested fields. |
70 | - foreach( $aFieldset[ '_field_path_array' ] as $_sPathPart ) { |
|
71 | - $_aDimensionalKeys[] = '[' . $_sPathPart . ']'; |
|
70 | + foreach ( $aFieldset[ '_field_path_array' ] as $_sPathPart ) { |
|
71 | + $_aDimensionalKeys[ ] = '['.$_sPathPart.']'; |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | return implode( '', $_aDimensionalKeys ); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function _replyToGetFlatFieldName( /* $sAttribute, $aFieldset */ ) { |
83 | 83 | |
84 | - $_aParams = func_get_args() + array( null, null, ); |
|
84 | + $_aParams = func_get_args() + array( null, null,); |
|
85 | 85 | $sNameAttribute = $_aParams[ 0 ]; |
86 | 86 | $aFieldset = $_aParams[ 1 ]; |
87 | 87 | |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | $this->oProp->sOptionKey // Use `$this->oProp->sOptionKey` instead of `$aFieldset[ 'option_key' ]` which is not set for nested items. |
90 | 90 | ); |
91 | 91 | if ( $this->isSectionSet( $aFieldset ) ) { |
92 | - foreach( $aFieldset[ '_section_path_array' ] as $_sDimension ) { |
|
93 | - $_aDimensionalKeys[] = $_sDimension; // $aFieldset[ 'section_id' ]; |
|
92 | + foreach ( $aFieldset[ '_section_path_array' ] as $_sDimension ) { |
|
93 | + $_aDimensionalKeys[ ] = $_sDimension; // $aFieldset[ 'section_id' ]; |
|
94 | 94 | } |
95 | 95 | if ( isset( $aFieldset[ '_section_index' ] ) ) { |
96 | - $_aDimensionalKeys[] = $aFieldset[ '_section_index' ]; |
|
96 | + $_aDimensionalKeys[ ] = $aFieldset[ '_section_index' ]; |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | |
@@ -122,8 +122,8 @@ discard block |
||
122 | 122 | "[{$sKey}]" |
123 | 123 | ); |
124 | 124 | |
125 | - $_sNamePrefix = $this->_replyToGetFieldNameAttribute( '', $aField ); |
|
126 | - return $_sNamePrefix . $sKey; |
|
125 | + $_sNamePrefix = $this->_replyToGetFieldNameAttribute( '', $aField ); |
|
126 | + return $_sNamePrefix.$sKey; |
|
127 | 127 | |
128 | 128 | } |
129 | 129 | /** |
@@ -141,10 +141,10 @@ discard block |
||
141 | 141 | $_sKey = $this->oUtil->getAOrB( |
142 | 142 | '0' !== $_sKey && empty( $_sKey ), |
143 | 143 | '', |
144 | - "|" . $_sKey |
|
144 | + "|".$_sKey |
|
145 | 145 | ); |
146 | 146 | |
147 | - return $this->_replyToGetFlatFieldName( '', $aField ) . $_sKey; |
|
147 | + return $this->_replyToGetFlatFieldName( '', $aField ).$_sKey; |
|
148 | 148 | |
149 | 149 | } |
150 | 150 |
@@ -399,6 +399,8 @@ |
||
399 | 399 | * Sets up necessary property values. |
400 | 400 | * |
401 | 401 | * @remark This class gets instantiated in every factory class so the constructor should be lightest as possible. |
402 | + * @param string $sCapability |
|
403 | + * @param string $sTextDomain |
|
402 | 404 | */ |
403 | 405 | public function __construct( $oCaller, $sCallerPath, $sClassName, $sCapability, $sTextDomain, $sStructureType ) { |
404 | 406 |
@@ -330,14 +330,14 @@ discard block |
||
330 | 330 | * @since 3.7.0 |
331 | 331 | */ |
332 | 332 | public $aFormCallbacks = array( |
333 | - 'hfID' => null, // the input id attribute |
|
334 | - 'hfTagID' => null, // the field container id attribute |
|
335 | - 'hfName' => null, // the field name attribute |
|
336 | - 'hfNameFlat' => null, // the flat field name attribute |
|
333 | + 'hfID' => null, // the input id attribute |
|
334 | + 'hfTagID' => null, // the field container id attribute |
|
335 | + 'hfName' => null, // the field name attribute |
|
336 | + 'hfNameFlat' => null, // the flat field name attribute |
|
337 | 337 | // @todo Document the differences between `hfName` and `hfInputName` |
338 | - 'hfInputName' => null, // 3.6.0+ the field input name attribute |
|
339 | - 'hfInputNameFlat' => null, // 3.6.0+ the flat field input name |
|
340 | - 'hfClass' => null, // the class attribute |
|
338 | + 'hfInputName' => null, // 3.6.0+ the field input name attribute |
|
339 | + 'hfInputNameFlat' => null, // 3.6.0+ the flat field input name |
|
340 | + 'hfClass' => null, // the class attribute |
|
341 | 341 | ); |
342 | 342 | |
343 | 343 | /** |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | */ |
465 | 465 | private function ___getURLQuery() { |
466 | 466 | |
467 | - if ( ! $this->bIsAdminAjax ) { |
|
467 | + if ( !$this->bIsAdminAjax ) { |
|
468 | 468 | return $_GET; |
469 | 469 | } |
470 | 470 | parse_str( |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | * @since 3.7.9 |
481 | 481 | */ |
482 | 482 | private function ___setGlobals() { |
483 | - if ( ! isset( $GLOBALS[ 'aAdminPageFramework' ] ) ) { |
|
483 | + if ( !isset( $GLOBALS[ 'aAdminPageFramework' ] ) ) { |
|
484 | 484 | $GLOBALS[ 'aAdminPageFramework' ] = array( |
485 | 485 | 'aFieldFlags' => array() |
486 | 486 | ); |
@@ -551,8 +551,8 @@ discard block |
||
551 | 551 | 'hfTagID' => array( $this->oCaller, '_replyToGetInputTagIDAttribute' ), // the fields & fieldset & field row container id attribute |
552 | 552 | 'hfName' => array( $this->oCaller, '_replyToGetFieldNameAttribute' ), // the input name attribute |
553 | 553 | 'hfNameFlat' => array( $this->oCaller, '_replyToGetFlatFieldName' ), // the flat input name attribute |
554 | - 'hfInputName' => array( $this->oCaller, '_replyToGetInputNameAttribute' ), // 3.6.0+ the field input name attribute |
|
555 | - 'hfInputNameFlat' => array( $this->oCaller, '_replyToGetFlatInputName' ), // 3.6.0+ the flat field input name |
|
554 | + 'hfInputName' => array( $this->oCaller, '_replyToGetInputNameAttribute' ), // 3.6.0+ the field input name attribute |
|
555 | + 'hfInputNameFlat' => array( $this->oCaller, '_replyToGetFlatInputName' ), // 3.6.0+ the flat field input name |
|
556 | 556 | 'hfClass' => array( $this->oCaller, '_replyToGetInputClassAttribute' ), // the class attribute |
557 | 557 | 'hfSectionName' => array( $this->oCaller, '_replyToGetSectionName' ), // 3.6.0+ |
558 | 558 | ) + $this->aFormCallbacks; |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | * @remark The information can be used to embed into the footer etc. |
627 | 627 | * @return array The information of the script. |
628 | 628 | */ |
629 | - protected function getCallerInfo( $sCallerPath='' ) { |
|
629 | + protected function getCallerInfo( $sCallerPath = '' ) { |
|
630 | 630 | |
631 | 631 | if ( isset( self::$_aScriptDataCaches[ $sCallerPath ] ) ) { |
632 | 632 | return self::$_aScriptDataCaches[ $sCallerPath ]; |
@@ -744,11 +744,11 @@ discard block |
||
744 | 744 | |
745 | 745 | // 3.7.9 Moved from the constructor to make it lighter. |
746 | 746 | if ( 'sClassHash' === $sName ) { |
747 | - $this->sClassHash = md5( $this->sClassName ); |
|
747 | + $this->sClassHash = md5( $this->sClassName ); |
|
748 | 748 | return $this->sClassHash; |
749 | 749 | } |
750 | 750 | if ( 'sScriptType' === $sName ) { |
751 | - $this->sScriptType = $this->_getCallerType( $this->sCallerPath ); // 3.7.6+ |
|
751 | + $this->sScriptType = $this->_getCallerType( $this->sCallerPath ); // 3.7.6+ |
|
752 | 752 | return $this->sScriptType; |
753 | 753 | } |
754 | 754 | if ( 'oUtil' === $sName ) { |
@@ -110,7 +110,6 @@ |
||
110 | 110 | * Retrieves the settings error array set by the user in the validation callback. |
111 | 111 | * |
112 | 112 | * @since 3.7.8 |
113 | - * @param boolean $bDelete whether or not the transient should be deleted after retrieving it. |
|
114 | 113 | * @return array |
115 | 114 | */ |
116 | 115 | public function get() { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $_sPageSlug = $this->getElement( $_GET, 'page', '' ); |
57 | 57 | $_sTabSlug = $this->getElement( $_GET, 'tab', '' ); |
58 | 58 | $_sUserID = get_current_user_id(); |
59 | - return "apf_li_" . md5( |
|
59 | + return "apf_li_".md5( |
|
60 | 60 | $_sPageNow |
61 | 61 | . $_sPageSlug |
62 | 62 | . $_sTabSlug |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | * @return void |
95 | 95 | */ |
96 | 96 | public function _replyToSave() { |
97 | - if ( ! isset( self::$_aLastInputs ) ) { |
|
97 | + if ( !isset( self::$_aLastInputs ) ) { |
|
98 | 98 | return; |
99 | 99 | } |
100 | 100 | $this->setTransient( |
101 | 101 | $this->sTransientKey, |
102 | 102 | self::$_aLastInputs, |
103 | - 60*60 // store it for 1 hour |
|
103 | + 60 * 60 // store it for 1 hour |
|
104 | 104 | ); |
105 | 105 | } |
106 | 106 | |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | $_aLastInputs = self::$_aCaches[ $this->sTransientKey ]; |
121 | 121 | } else { |
122 | 122 | $_aLastInputs = $this->getTransient( $this->sTransientKey ); |
123 | - self::$_aCaches[ $this->sTransientKey ] = $_aLastInputs; |
|
123 | + self::$_aCaches[ $this->sTransientKey ] = $_aLastInputs; |
|
124 | 124 | if ( false !== $_aLastInputs ) { |
125 | - $this->delete(); // deletes at the end of the script. |
|
125 | + $this->delete(); // deletes at the end of the script. |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 |
@@ -99,6 +99,7 @@ discard block |
||
99 | 99 | * @since 3.1.1 Added a parameter. Changed to return the formatted sections array. |
100 | 100 | * @since 3.7.0 Moved from `AdminPageFramework_FormDefinition`. Changed the name from `formatFields()`. |
101 | 101 | * Added the `$aSectionsets` parameter. |
102 | + * @param string $sCapability |
|
102 | 103 | * @return array |
103 | 104 | */ |
104 | 105 | private function _getFieldsetsFormatted( array $aFieldsets, array $aSectionsets, $sCapability ) { |
@@ -278,6 +279,7 @@ discard block |
||
278 | 279 | * |
279 | 280 | * @since 3.0.0 |
280 | 281 | * @since 3.7.0 Moved from `AdminPageFramework_FormDefinition`. Changed the name from `formatField()`. |
282 | + * @param integer $iCountOfElements |
|
281 | 283 | * @return array|void An array of formatted field definition array. If required keys are not set, nothing will be returned. |
282 | 284 | */ |
283 | 285 | private function _getFieldsetFormatted( $aFieldset, $aSectionsets, $sCapability, $iCountOfElements, $iSubSectionIndex, $bIsSectionRepeatable, $oCallerObject ) { |
@@ -113,10 +113,10 @@ discard block |
||
113 | 113 | ); |
114 | 114 | |
115 | 115 | $_aNewFieldsets = array(); |
116 | - foreach( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
116 | + foreach ( $aFieldsets as $_sSectionPath => $_aItems ) { |
|
117 | 117 | |
118 | 118 | // If the section is not set, skip. |
119 | - if ( ! isset( $aSectionsets[ $_sSectionPath ] ) ) { |
|
119 | + if ( !isset( $aSectionsets[ $_sSectionPath ] ) ) { |
|
120 | 120 | continue; |
121 | 121 | } |
122 | 122 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $_aItems, |
126 | 126 | $this->getElement( // 3.6.0+ Get the section's capability |
127 | 127 | $aSectionsets, |
128 | - array( $_sSectionPath, 'capability', ), |
|
128 | + array( $_sSectionPath, 'capability',), |
|
129 | 129 | $sCapability |
130 | 130 | ), |
131 | 131 | $aSectionsets |
@@ -182,16 +182,16 @@ discard block |
||
182 | 182 | */ |
183 | 183 | private function _getNormalFieldsetsFormatted( $aItems, $sCapability, $aSectionsets, $_abSectionRepeatable ) { |
184 | 184 | |
185 | - $_aNewItems = array(); |
|
186 | - foreach( $aItems as $_sFieldID => $_aFieldset ) { |
|
185 | + $_aNewItems = array(); |
|
186 | + foreach ( $aItems as $_sFieldID => $_aFieldset ) { |
|
187 | 187 | |
188 | 188 | // Insert the formatted field definition array. The fields count is needed to set each order value. |
189 | - $_aFieldset = $this->_getFieldsetFormatted( |
|
189 | + $_aFieldset = $this->_getFieldsetFormatted( |
|
190 | 190 | $_aFieldset, |
191 | 191 | $aSectionsets, |
192 | 192 | $sCapability, |
193 | 193 | count( $_aNewItems ), // index of elements - zero based |
194 | - null, // sub-section index |
|
194 | + null, // sub-section index |
|
195 | 195 | $_abSectionRepeatable, |
196 | 196 | $this->oCallerForm |
197 | 197 | ); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | * @return boolean |
211 | 211 | */ |
212 | 212 | private function _isSubSections( $aItems, $_abSectionRepeatable ) { |
213 | - if ( ! empty( $_abSectionRepeatable ) ) { |
|
213 | + if ( !empty( $_abSectionRepeatable ) ) { |
|
214 | 214 | return true; |
215 | 215 | } |
216 | 216 | return ( boolean ) count( $this->getIntegerKeyElements( $aItems ) ); |
@@ -221,9 +221,9 @@ discard block |
||
221 | 221 | private function _getSubSectionsFormatted( $aItems, $sCapability, $aSectionsets, $_abSectionRepeatable ) { |
222 | 222 | |
223 | 223 | $_aNewFieldset = array(); |
224 | - foreach( $this->numerizeElements( $aItems ) as $_iSubSectionIndex => $_aFieldsets ) { |
|
224 | + foreach ( $this->numerizeElements( $aItems ) as $_iSubSectionIndex => $_aFieldsets ) { |
|
225 | 225 | |
226 | - foreach( $_aFieldsets as $_aFieldset ) { |
|
226 | + foreach ( $_aFieldsets as $_aFieldset ) { |
|
227 | 227 | $_iCountElement = count( $this->getElementAsArray( $_aNewFieldset, $_iSubSectionIndex ) ); |
228 | 228 | $_aFieldset = $this->_getFieldsetFormatted( |
229 | 229 | $_aFieldset, |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | if ( empty( $_aFieldset ) ) { |
238 | 238 | continue; |
239 | 239 | } |
240 | - $_aNewFieldset[ $_iSubSectionIndex ][ $_aFieldset['field_id'] ] = $_aFieldset; |
|
240 | + $_aNewFieldset[ $_iSubSectionIndex ][ $_aFieldset[ 'field_id' ] ] = $_aFieldset; |
|
241 | 241 | } |
242 | 242 | uasort( $_aNewFieldset[ $_iSubSectionIndex ], array( $this, 'sortArrayByKey' ) ); |
243 | 243 | |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | } |
265 | 265 | |
266 | 266 | $_aSortedFields = array(); |
267 | - foreach( $aSectionsets as $_sSectionPath => $_aSecitonset ) { |
|
267 | + foreach ( $aSectionsets as $_sSectionPath => $_aSecitonset ) { |
|
268 | 268 | if ( isset( $aFieldsets[ $_sSectionPath ] ) ) { |
269 | 269 | $_aSortedFields[ $_sSectionPath ] = $aFieldsets[ $_sSectionPath ]; |
270 | 270 | } |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | private function _getFieldsetFormatted( $aFieldset, $aSectionsets, $sCapability, $iCountOfElements, $iSubSectionIndex, $bIsSectionRepeatable, $oCallerObject ) { |
284 | 284 | |
285 | 285 | // 3.8.0+ Dropped the check for $aFieldset[ 'type' ] to allow it to be omitted. |
286 | - if ( ! isset( $aFieldset[ 'field_id' ] ) ) { |
|
286 | + if ( !isset( $aFieldset[ 'field_id' ] ) ) { |
|
287 | 287 | return; |
288 | 288 | } |
289 | 289 |
@@ -30,7 +30,6 @@ |
||
30 | 30 | * Returns the field container attribute array. |
31 | 31 | * |
32 | 32 | * @remark Formatting each sub-field should be performed prior to calling this method. |
33 | - * @param array $aField The (sub-)field definition array. This should have been formatted already. |
|
34 | 33 | * @return array The generated field container attribute array. |
35 | 34 | * @internal |
36 | 35 | * @since 3.5.3 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @since 3.6.0 |
26 | 26 | */ |
27 | - public $sContext = 'field'; |
|
27 | + public $sContext = 'field'; |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Returns the field container attribute array. |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | protected function _getAttributes() { |
41 | 41 | |
42 | 42 | // 3.8.0+ Supports omitting the `type` argument. |
43 | - $_sFieldTypeSelector = $this->getAOrB( |
|
43 | + $_sFieldTypeSelector = $this->getAOrB( |
|
44 | 44 | $this->aArguments[ 'type' ], |
45 | 45 | " admin-page-framework-field-{$this->aArguments[ 'type' ]}", |
46 | 46 | '' |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | |
66 | 66 | return array( |
67 | 67 | 'id' => $this->aArguments[ '_field_container_id' ], |
68 | - 'data-type' => $this->aArguments[ 'type' ], // referred by the repeatable field JavaScript script. |
|
68 | + 'data-type' => $this->aArguments[ 'type' ], // referred by the repeatable field JavaScript script. |
|
69 | 69 | 'class' => "admin-page-framework-field{$_sFieldTypeSelector}{$_sNestedFieldSelector}{$_sMixedFieldSelector}{$_sChildFieldSelector}" |
70 | 70 | . $this->getAOrB( |
71 | 71 | $this->aArguments[ 'attributes' ][ 'disabled' ], |
@@ -126,6 +126,7 @@ discard block |
||
126 | 126 | * Retrieves a field output. |
127 | 127 | * |
128 | 128 | * @since 3.8.0 |
129 | + * @param boolean $bIsLastElement |
|
129 | 130 | * @return string |
130 | 131 | */ |
131 | 132 | private function _getFieldOutput( $sContent, $aField, $bIsLastElement ) { |
@@ -204,6 +205,7 @@ discard block |
||
204 | 205 | * Returns the final fields output. |
205 | 206 | * |
206 | 207 | * @since 3.1.0 |
208 | + * @param integer $iFieldsCount |
|
207 | 209 | * @return string |
208 | 210 | */ |
209 | 211 | private function _getFinalOutput( $aFieldset, array $aFieldsOutput, $iFieldsCount ) { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $this->aFieldset[ '_field_path_array' ], |
38 | 38 | $this->aFieldset[ 'error_message' ] |
39 | 39 | ); |
40 | - $_aOutputs[] = $_oFieldError->get(); |
|
40 | + $_aOutputs[ ] = $_oFieldError->get(); |
|
41 | 41 | |
42 | 42 | // 2. Construct fields array for sub-fields. |
43 | 43 | $_oFieldsFormatter = new AdminPageFramework_Form_Model___Format_Fields( |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $_aFields = $_oFieldsFormatter->get(); |
48 | 48 | |
49 | 49 | // 3. Get the field and its sub-fields output. |
50 | - $_aOutputs[] = $this->_getFieldsOutput( |
|
50 | + $_aOutputs[ ] = $this->_getFieldsOutput( |
|
51 | 51 | $this->aFieldset, |
52 | 52 | $_aFields, |
53 | 53 | $this->aCallbacks |
@@ -70,11 +70,11 @@ discard block |
||
70 | 70 | * @since 3.8.0 Added the `$aFieldset` parameter |
71 | 71 | * @return string |
72 | 72 | */ |
73 | - private function _getFieldsOutput( $aFieldset, array $aFields, array $aCallbacks=array() ) { |
|
73 | + private function _getFieldsOutput( $aFieldset, array $aFields, array $aCallbacks = array() ) { |
|
74 | 74 | |
75 | 75 | $_aOutput = array(); |
76 | - foreach( $aFields as $_isIndex => $_aField ) { |
|
77 | - $_aOutput[] = $this->_getEachFieldOutput( |
|
76 | + foreach ( $aFields as $_isIndex => $_aField ) { |
|
77 | + $_aOutput[ ] = $this->_getEachFieldOutput( |
|
78 | 78 | $_aField, |
79 | 79 | $_isIndex, |
80 | 80 | $aCallbacks, |
@@ -93,11 +93,11 @@ discard block |
||
93 | 93 | * @since 3.5.3 |
94 | 94 | * @return string the HTML output of the given field. |
95 | 95 | */ |
96 | - private function _getEachFieldOutput( $aField, $isIndex, array $aCallbacks, $bIsLastElement=false ) { |
|
96 | + private function _getEachFieldOutput( $aField, $isIndex, array $aCallbacks, $bIsLastElement = false ) { |
|
97 | 97 | |
98 | 98 | // Field type definition - allows mixed field types in sub-fields |
99 | 99 | $_aFieldTypeDefinition = $this->_getFieldTypeDefinition( $aField[ 'type' ] ); |
100 | - if ( ! is_callable( $_aFieldTypeDefinition[ 'hfRenderField' ] ) ) { |
|
100 | + if ( !is_callable( $_aFieldTypeDefinition[ 'hfRenderField' ] ) ) { |
|
101 | 101 | return ''; |
102 | 102 | } |
103 | 103 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | private function _getFieldOutput( $sContent, $aField, $bIsLastElement ) { |
132 | 132 | $_oFieldAttribute = new AdminPageFramework_Form_View___Attribute_Field( $aField ); |
133 | 133 | return $aField[ 'before_field' ] |
134 | - . "<div " . $_oFieldAttribute->get() . ">" |
|
134 | + . "<div ".$_oFieldAttribute->get().">" |
|
135 | 135 | . $sContent |
136 | 136 | . $this->_getUnsetFlagFieldInputTag( $aField ) |
137 | 137 | . $this->_getDelimiter( $aField, $bIsLastElement ) |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | 'input', |
154 | 154 | array( |
155 | 155 | 'type' => 'hidden', |
156 | - 'name' => '__unset_' . $aField[ '_fields_type' ] . '[' . $aField[ '_input_name_flat' ] . ']', |
|
156 | + 'name' => '__unset_'.$aField[ '_fields_type' ].'['.$aField[ '_input_name_flat' ].']', |
|
157 | 157 | 'value' => $aField[ '_input_name_flat' ], |
158 | 158 | 'class' => 'unset-element-names element-address', |
159 | 159 | ) |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | private function _getDelimiter( $aField, $bIsLastElement ) { |
186 | 186 | return $aField[ 'delimiter' ] |
187 | - ? "<div " . $this->getAttributes( |
|
187 | + ? "<div ".$this->getAttributes( |
|
188 | 188 | array( |
189 | 189 | 'class' => 'delimiter', |
190 | 190 | 'id' => "delimiter-{$aField[ 'input_id' ]}", |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | "" |
195 | 195 | ), |
196 | 196 | ) |
197 | - ) . ">" |
|
197 | + ).">" |
|
198 | 198 | . $aField[ 'delimiter' ] |
199 | 199 | . "</div>" |
200 | 200 | : ''; |
@@ -208,9 +208,9 @@ discard block |
||
208 | 208 | */ |
209 | 209 | private function _getFinalOutput( $aFieldset, array $aFieldsOutput, $iFieldsCount ) { |
210 | 210 | |
211 | - $_oFieldsetAttributes = new AdminPageFramework_Form_View___Attribute_Fieldset( $aFieldset ); |
|
211 | + $_oFieldsetAttributes = new AdminPageFramework_Form_View___Attribute_Fieldset( $aFieldset ); |
|
212 | 212 | return $aFieldset[ 'before_fieldset' ] |
213 | - . "<fieldset " . $_oFieldsetAttributes->get() . ">" |
|
213 | + . "<fieldset ".$_oFieldsetAttributes->get().">" |
|
214 | 214 | . $this->_getEmbeddedFieldTitle( $aFieldset ) |
215 | 215 | . $this->_getChildFieldTitle( $aFieldset ) |
216 | 216 | . $this->_getFieldsetContent( $aFieldset, $aFieldsOutput, $iFieldsCount ) |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | */ |
228 | 228 | private function _getEmbeddedFieldTitle( $aFieldset ) { |
229 | 229 | |
230 | - if ( ! $aFieldset[ '_is_title_embedded' ] ) { |
|
230 | + if ( !$aFieldset[ '_is_title_embedded' ] ) { |
|
231 | 231 | return ''; |
232 | 232 | } |
233 | 233 | |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | */ |
253 | 253 | private function _getChildFieldTitle( $aFieldset ) { |
254 | 254 | |
255 | - if ( ! $aFieldset[ '_nested_depth' ] ) { |
|
255 | + if ( !$aFieldset[ '_nested_depth' ] ) { |
|
256 | 256 | return ''; |
257 | 257 | } |
258 | 258 | if ( $aFieldset[ '_is_title_embedded' ] ) { |
@@ -281,12 +281,12 @@ discard block |
||
281 | 281 | return $aFieldset[ 'content' ]; |
282 | 282 | } |
283 | 283 | |
284 | - $_oFieldsAttributes = new AdminPageFramework_Form_View___Attribute_Fields( |
|
284 | + $_oFieldsAttributes = new AdminPageFramework_Form_View___Attribute_Fields( |
|
285 | 285 | $aFieldset, |
286 | - array(), // attribute array |
|
286 | + array(), // attribute array |
|
287 | 287 | $iFieldsCount |
288 | 288 | ); |
289 | - return "<div " . $_oFieldsAttributes->get() . ">" |
|
289 | + return "<div ".$_oFieldsAttributes->get().">" |
|
290 | 290 | . $aFieldset[ 'before_fields' ] |
291 | 291 | . implode( PHP_EOL, $aFieldsOutput ) |
292 | 292 | . $aFieldset[ 'after_fields' ] |
@@ -309,13 +309,13 @@ discard block |
||
309 | 309 | $aField[ 'description' ], |
310 | 310 | 'admin-page-framework-fields-description' // class selector |
311 | 311 | ); |
312 | - $_aOutput[] = $_oFieldDescription->get(); |
|
312 | + $_aOutput[ ] = $_oFieldDescription->get(); |
|
313 | 313 | |
314 | 314 | // Dimensional keys of repeatable and sortable fields |
315 | - $_aOutput[] = $this->_getDynamicElementFlagFieldInputTag( $aField ); |
|
315 | + $_aOutput[ ] = $this->_getDynamicElementFlagFieldInputTag( $aField ); |
|
316 | 316 | |
317 | 317 | // Repeatable and sortable scripts |
318 | - $_aOutput[] = $this->_getFieldScripts( $aField, $iFieldsCount ); |
|
318 | + $_aOutput[ ] = $this->_getFieldScripts( $aField, $iFieldsCount ); |
|
319 | 319 | |
320 | 320 | return implode( PHP_EOL, array_filter( $_aOutput ) ); |
321 | 321 | |
@@ -327,10 +327,10 @@ discard block |
||
327 | 327 | */ |
328 | 328 | private function _getDynamicElementFlagFieldInputTag( $aFieldset ) { |
329 | 329 | |
330 | - if ( ! empty( $aFieldset[ 'repeatable' ] ) ) { |
|
330 | + if ( !empty( $aFieldset[ 'repeatable' ] ) ) { |
|
331 | 331 | return $this->_getRepeatableFieldFlagTag( $aFieldset ); |
332 | 332 | } |
333 | - if ( ! empty( $aFieldset[ 'sortable' ] ) ) { |
|
333 | + if ( !empty( $aFieldset[ 'sortable' ] ) ) { |
|
334 | 334 | return $this->_getSortableFieldFlagTag( $aFieldset ); |
335 | 335 | } |
336 | 336 | return ''; |
@@ -345,8 +345,8 @@ discard block |
||
345 | 345 | 'input', |
346 | 346 | array( |
347 | 347 | 'type' => 'hidden', |
348 | - 'name' => '__repeatable_elements_' . $aFieldset[ '_structure_type' ] |
|
349 | - . '[' . $aFieldset[ '_field_address' ] . ']', |
|
348 | + 'name' => '__repeatable_elements_'.$aFieldset[ '_structure_type' ] |
|
349 | + . '['.$aFieldset[ '_field_address' ].']', |
|
350 | 350 | 'class' => 'element-address', |
351 | 351 | 'value' => $aFieldset[ '_field_address' ], |
352 | 352 | 'data-field_address_model' => $aFieldset[ '_field_address_model' ], |
@@ -362,8 +362,8 @@ discard block |
||
362 | 362 | 'input', |
363 | 363 | array( |
364 | 364 | 'type' => 'hidden', |
365 | - 'name' => '__sortable_elements_' . $aFieldset[ '_structure_type' ] |
|
366 | - . '[' . $aFieldset[ '_field_address' ] . ']', |
|
365 | + 'name' => '__sortable_elements_'.$aFieldset[ '_structure_type' ] |
|
366 | + . '['.$aFieldset[ '_field_address' ].']', |
|
367 | 367 | 'class' => 'element-address', |
368 | 368 | 'value' => $aFieldset[ '_field_address' ], |
369 | 369 | 'data-field_address_model' => $aFieldset[ '_field_address_model' ], |
@@ -382,14 +382,14 @@ discard block |
||
382 | 382 | $_aOutput = array(); |
383 | 383 | |
384 | 384 | // Add the repeater script |
385 | - $_aOutput[] = ! empty( $aField[ 'repeatable' ] ) |
|
386 | - ? $this->_getRepeaterFieldEnablerScript( 'fields-' . $aField[ 'tag_id' ], $iFieldsCount, $aField[ 'repeatable' ] ) |
|
385 | + $_aOutput[ ] = !empty( $aField[ 'repeatable' ] ) |
|
386 | + ? $this->_getRepeaterFieldEnablerScript( 'fields-'.$aField[ 'tag_id' ], $iFieldsCount, $aField[ 'repeatable' ] ) |
|
387 | 387 | : ''; |
388 | 388 | |
389 | 389 | // Add the sortable script - if the number of fields is only one, no need to sort the field. |
390 | 390 | // Repeatable fields can make the number increase so here it checks the repeatability. |
391 | - $_aOutput[] = ! empty( $aField[ 'sortable' ] ) && ( $iFieldsCount > 1 || ! empty( $aField[ 'repeatable' ] ) ) |
|
392 | - ? $this->_getSortableFieldEnablerScript( 'fields-' . $aField[ 'tag_id' ] ) |
|
391 | + $_aOutput[ ] = !empty( $aField[ 'sortable' ] ) && ( $iFieldsCount > 1 || !empty( $aField[ 'repeatable' ] ) ) |
|
392 | + ? $this->_getSortableFieldEnablerScript( 'fields-'.$aField[ 'tag_id' ] ) |
|
393 | 393 | : ''; |
394 | 394 | |
395 | 395 | return implode( PHP_EOL, $_aOutput ); |
@@ -80,10 +80,6 @@ discard block |
||
80 | 80 | * ` |
81 | 81 | * @since 3.7.0 |
82 | 82 | * @access public |
83 | - * @param string $sMessage the text message to be displayed. |
|
84 | - * @param string $sType (optional) the type of the message, either "error" or "updated" is used. |
|
85 | - * @param array $asAttributes (optional) the tag attribute array applied to the message container HTML element. If a string is given, it is used as the ID attribute value. |
|
86 | - * @param boolean $bOverride (optional) If true, only one message will be shown in the next page load. false: do not override when there is a message of the same id. true: override the previous one. |
|
87 | 83 | * @return void |
88 | 84 | */ |
89 | 85 | public function set( $aErrors ) { |
@@ -128,7 +124,6 @@ discard block |
||
128 | 124 | * Retrieves the settings error array set by the user in the validation callback. |
129 | 125 | * |
130 | 126 | * @since 3.7.0 |
131 | - * @param boolean $bDelete whether or not the transient should be deleted after retrieving it. |
|
132 | 127 | * @return array |
133 | 128 | */ |
134 | 129 | public function get() { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $_sPageSlug = $this->getElement( $_GET, 'page', '' ); |
47 | 47 | $_sTabSlug = $this->getElement( $_GET, 'tab', '' ); |
48 | 48 | $_sUserID = get_current_user_id(); |
49 | - return "apf_fe_" . md5( |
|
49 | + return "apf_fe_".md5( |
|
50 | 50 | $_sPageNow |
51 | 51 | . $_sPageSlug |
52 | 52 | . $_sTabSlug |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | public function get() { |
135 | 135 | |
136 | 136 | // Use a cache if exists. |
137 | - self::$_aFieldErrorCaches[ $this->sTransientKey ] = isset( self::$_aFieldErrorCaches[ $this->sTransientKey ] ) |
|
137 | + self::$_aFieldErrorCaches[ $this->sTransientKey ] = isset( self::$_aFieldErrorCaches[ $this->sTransientKey ] ) |
|
138 | 138 | ? self::$_aFieldErrorCaches[ $this->sTransientKey ] |
139 | 139 | : $this->getTransient( $this->sTransientKey ); |
140 | 140 | |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | * @since 3.7.0 |
152 | 152 | */ |
153 | 153 | public function delete() { |
154 | - if ( $this->hasBeenCalled( 'delete_' . $this->sTransientKey ) ) { |
|
154 | + if ( $this->hasBeenCalled( 'delete_'.$this->sTransientKey ) ) { |
|
155 | 155 | return; |
156 | 156 | } |
157 | 157 | add_action( 'shutdown', array( $this, '_replyToDelete' ) ); |