@@ -203,6 +203,7 @@ discard block |
||
203 | 203 | * Constructs a WordPress filter hook name. |
204 | 204 | * @internal |
205 | 205 | * @since 3.8.4 |
206 | + * @param string $sPrefix |
|
206 | 207 | * @return string |
207 | 208 | */ |
208 | 209 | private function _getHookNameByFieldsetAndPrefix( $sPrefix, $aFieldset ) { |
@@ -339,8 +340,6 @@ discard block |
||
339 | 340 | * @since 3.7.0 Changed back the visibility scope to protected as there is the `getFieldErrors()` public method. |
340 | 341 | * @access protected |
341 | 342 | * @internal |
342 | - * @param string $sID deprecated |
|
343 | - * @param boolean $bDelete whether or not the transient should be deleted after retrieving it. |
|
344 | 343 | * @return array |
345 | 344 | * @deprecated 3.7.0 Use `getFieldErrors()` instead. Kept for backward compatibility. |
346 | 345 | */ |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | add_filter( |
34 | 34 | // 'field_types_admin_page_framework', |
35 | - 'field_types_' . $oProp->sClassName, |
|
35 | + 'field_types_'.$oProp->sClassName, |
|
36 | 36 | array( $this, '_replyToFilterFieldTypeDefinitions' ) |
37 | 37 | ); |
38 | 38 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | 'title' => null, |
66 | 66 | 'help_aside' => null, |
67 | 67 | ); |
68 | - if ( ! $aFieldset[ 'help' ] ) { |
|
68 | + if ( !$aFieldset[ 'help' ] ) { |
|
69 | 69 | return; |
70 | 70 | } |
71 | 71 | $this->oHelpPane->_addHelpTextForFormFields( |
@@ -85,9 +85,9 @@ discard block |
||
85 | 85 | public function _replyToFilterFieldTypeDefinitions( $aFieldTypeDefinitions ) { |
86 | 86 | |
87 | 87 | // Not triggering `__call()` as the filter is fired manually in the form class. |
88 | - if ( method_exists( $this, 'field_types_' . $this->oProp->sClassName ) ) { |
|
88 | + if ( method_exists( $this, 'field_types_'.$this->oProp->sClassName ) ) { |
|
89 | 89 | return call_user_func_array( |
90 | - array( $this, 'field_types_' . $this->oProp->sClassName ), |
|
90 | + array( $this, 'field_types_'.$this->oProp->sClassName ), |
|
91 | 91 | array( $aFieldTypeDefinitions ) |
92 | 92 | ); |
93 | 93 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | public function _replyToModifySectionsets( $aSectionsets ) { |
109 | 109 | |
110 | 110 | return $this->oUtil->addAndApplyFilter( |
111 | - $this, // caller factory object |
|
111 | + $this, // caller factory object |
|
112 | 112 | "sections_{$this->oProp->sClassName}", |
113 | 113 | $aSectionsets |
114 | 114 | ); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | public function _replyToModifyFieldsets( $aFieldsets, $aSectionsets ) { |
129 | 129 | |
130 | 130 | // Apply filters to added fieldsets |
131 | - foreach( $aFieldsets as $_sSectionPath => $_aFields ) { |
|
131 | + foreach ( $aFieldsets as $_sSectionPath => $_aFields ) { |
|
132 | 132 | $_aSectionPath = explode( '|', $_sSectionPath ); |
133 | 133 | $_sFilterSuffix = implode( '_', $_aSectionPath ); |
134 | 134 | $aFieldsets[ $_sSectionPath ] = $this->oUtil->addAndApplyFilter( |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $_aFields |
138 | 138 | ); |
139 | 139 | } |
140 | - $aFieldsets = $this->oUtil->addAndApplyFilter( |
|
140 | + $aFieldsets = $this->oUtil->addAndApplyFilter( |
|
141 | 141 | $this, |
142 | 142 | "fields_{$this->oProp->sClassName}", |
143 | 143 | $aFieldsets |
@@ -207,14 +207,14 @@ discard block |
||
207 | 207 | */ |
208 | 208 | private function _getHookNameByFieldsetAndPrefix( $sPrefix, $aFieldset ) { |
209 | 209 | |
210 | - $_sFieldPart = '_' . implode( '_', $aFieldset[ '_field_path_array' ] ); |
|
210 | + $_sFieldPart = '_'.implode( '_', $aFieldset[ '_field_path_array' ] ); |
|
211 | 211 | $_sSectionPart = implode( '_', $aFieldset[ '_section_path_array' ] ); |
212 | 212 | $_sSectionPart = $this->oUtil->getAOrB( |
213 | 213 | '_default' === $_sSectionPart, |
214 | 214 | '', |
215 | - '_' . $_sSectionPart |
|
215 | + '_'.$_sSectionPart |
|
216 | 216 | ); |
217 | - return $sPrefix . $this->oProp->sClassName . $_sSectionPart . $_sFieldPart; |
|
217 | + return $sPrefix.$this->oProp->sClassName.$_sSectionPart.$_sFieldPart; |
|
218 | 218 | |
219 | 219 | } |
220 | 220 | |
@@ -284,9 +284,9 @@ discard block |
||
284 | 284 | public function _replyToGetSavedFormData() { |
285 | 285 | |
286 | 286 | // Must update the property with the filtered value. |
287 | - $this->oProp->aOptions = $this->oUtil->addAndApplyFilter( |
|
287 | + $this->oProp->aOptions = $this->oUtil->addAndApplyFilter( |
|
288 | 288 | $this, // the caller factory object |
289 | - 'options_' . $this->oProp->sClassName, |
|
289 | + 'options_'.$this->oProp->sClassName, |
|
290 | 290 | $this->oProp->aOptions // subject value to be filtered |
291 | 291 | ); |
292 | 292 | return $this->oProp->aOptions; |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | * An alias of `_setLastInputs()`. |
367 | 367 | * @deprecated 3.7.0 |
368 | 368 | */ |
369 | - public function _setLastInput( $aLastInputs ) { |
|
369 | + public function _setLastInput( $aLastInputs ) { |
|
370 | 370 | return $this->setLastInputs( $aLastInputs ); |
371 | 371 | } |
372 | 372 |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | * @since 3.7.0 |
94 | 94 | * @return array The modified section-sets definition array. |
95 | 95 | */ |
96 | - public function _replyToModifySectionsets( $aSectionsets ) { |
|
96 | + public function _replyToModifySectionsets( $aSectionsets ) { |
|
97 | 97 | |
98 | 98 | return $this->oUtil->addAndApplyFilter( |
99 | 99 | $this, // caller factory object |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | * An alias of `_setLastInputs()`. |
365 | 365 | * @deprecated 3.7.0 |
366 | 366 | */ |
367 | - public function _setLastInput( $aLastInputs ) { |
|
367 | + public function _setLastInput( $aLastInputs ) { |
|
368 | 368 | return $this->setLastInputs( $aLastInputs ); |
369 | 369 | } |
370 | 370 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | $_aParameters = func_get_args() + array( |
35 | 35 | $this->aFieldset, |
36 | - $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
36 | + $this->aSavedData, // passed by reference. @todo: examine why it needs to be passed by reference. |
|
37 | 37 | $this->aFieldErrors, |
38 | 38 | $this->aFieldTypeDefinitions, |
39 | 39 | $this->aCallbacks, // field output element callables. |
@@ -61,14 +61,14 @@ discard block |
||
61 | 61 | |
62 | 62 | $aFieldset = $this->aFieldset; |
63 | 63 | |
64 | - if ( ! $this->isNormalPlacement( $aFieldset ) ) { |
|
64 | + if ( !$this->isNormalPlacement( $aFieldset ) ) { |
|
65 | 65 | return ''; |
66 | 66 | } |
67 | 67 | |
68 | - $_oFieldrowAttribute = new AdminPageFramework_Form_View___Attribute_Fieldrow( |
|
68 | + $_oFieldrowAttribute = new AdminPageFramework_Form_View___Attribute_Fieldrow( |
|
69 | 69 | $aFieldset, |
70 | 70 | array( |
71 | - 'id' => 'fieldrow-' . $aFieldset[ 'tag_id' ], |
|
71 | + 'id' => 'fieldrow-'.$aFieldset[ 'tag_id' ], |
|
72 | 72 | 'valign' => 'top', |
73 | 73 | 'class' => 'admin-page-framework-fieldrow', |
74 | 74 | ) |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | return $this->_getFieldByContainer( |
78 | 78 | $aFieldset, |
79 | 79 | array( |
80 | - 'open_container' => "<tr " . $_oFieldrowAttribute->get() . ">", |
|
80 | + 'open_container' => "<tr ".$_oFieldrowAttribute->get().">", |
|
81 | 81 | 'close_container' => "</tr>", |
82 | 82 | 'open_title' => "<th>", |
83 | 83 | 'close_title' => "</th>", |
@@ -126,13 +126,13 @@ discard block |
||
126 | 126 | $this->aCallbacks, |
127 | 127 | $this->oMsg |
128 | 128 | ); |
129 | - $_aOutput = array(); |
|
129 | + $_aOutput = array(); |
|
130 | 130 | if ( $aFieldset[ 'show_title_column' ] ) { |
131 | - $_aOutput[] = $aOpenCloseTags[ 'open_title' ] |
|
131 | + $_aOutput[ ] = $aOpenCloseTags[ 'open_title' ] |
|
132 | 132 | . $_oFieldTitle->get() |
133 | 133 | . $aOpenCloseTags[ 'close_title' ]; |
134 | 134 | } |
135 | - $_aOutput[] = $aOpenCloseTags[ 'open_main' ] |
|
135 | + $_aOutput[ ] = $aOpenCloseTags[ 'open_main' ] |
|
136 | 136 | // . call_user_func_array( $hfCallback, array( $aFieldset ) ) |
137 | 137 | . $this->getFieldsetOutput( $aFieldset ) |
138 | 138 | . $aOpenCloseTags[ 'close_main' ]; |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | * Defines the default key-values of this field type. |
78 | 78 | */ |
79 | 79 | protected $aDefaultKeys = array( |
80 | - 'select_all_button' => false, // 3.3.0+ to change the label, set the label here |
|
81 | - 'select_none_button' => false, // 3.3.0+ to change the label, set the label here |
|
82 | - 'save_unchecked' => true, // (optional, boolean) 3.8.8+ Whether to store the values of unchecked items. |
|
80 | + 'select_all_button' => false, // 3.3.0+ to change the label, set the label here |
|
81 | + 'select_none_button' => false, // 3.3.0+ to change the label, set the label here |
|
82 | + 'save_unchecked' => true, // (optional, boolean) 3.8.8+ Whether to store the values of unchecked items. |
|
83 | 83 | ); |
84 | 84 | |
85 | 85 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | protected function getScripts() { |
93 | 93 | new AdminPageFramework_Form_View___Script_CheckboxSelector; |
94 | - $_sClassSelectorSelectAll = $this->_getSelectButtonClassSelectors( |
|
94 | + $_sClassSelectorSelectAll = $this->_getSelectButtonClassSelectors( |
|
95 | 95 | $this->aFieldTypeSlugs, |
96 | 96 | 'select_all_button' // data attribute |
97 | 97 | ); |
@@ -118,14 +118,14 @@ discard block |
||
118 | 118 | * @return string |
119 | 119 | * @internal |
120 | 120 | */ |
121 | - private function _getSelectButtonClassSelectors( array $aFieldTypeSlugs, $sDataAttribute='select_all_button' ) { |
|
121 | + private function _getSelectButtonClassSelectors( array $aFieldTypeSlugs, $sDataAttribute = 'select_all_button' ) { |
|
122 | 122 | |
123 | 123 | $_aClassSelectors = array(); |
124 | 124 | foreach ( $aFieldTypeSlugs as $_sSlug ) { |
125 | - if ( ! is_scalar( $_sSlug ) ) { |
|
125 | + if ( !is_scalar( $_sSlug ) ) { |
|
126 | 126 | continue; |
127 | 127 | } |
128 | - $_aClassSelectors[] = '.admin-page-framework-checkbox-container-' . $_sSlug . "[data-{$sDataAttribute}]"; |
|
128 | + $_aClassSelectors[ ] = '.admin-page-framework-checkbox-container-'.$_sSlug."[data-{$sDataAttribute}]"; |
|
129 | 129 | } |
130 | 130 | return implode( ',', $_aClassSelectors ); |
131 | 131 | |
@@ -186,8 +186,8 @@ discard block |
||
186 | 186 | |
187 | 187 | $_aOutput = array(); |
188 | 188 | $_bIsMultiple = is_array( $aField[ 'label' ] ); |
189 | - foreach( $this->getAsArray( $aField[ 'label' ], true ) as $_sKey => $_sLabel ) { |
|
190 | - $_aOutput[] = $this->_getEachCheckboxOutput( |
|
189 | + foreach ( $this->getAsArray( $aField[ 'label' ], true ) as $_sKey => $_sLabel ) { |
|
190 | + $_aOutput[ ] = $this->_getEachCheckboxOutput( |
|
191 | 191 | $aField, |
192 | 192 | $_bIsMultiple |
193 | 193 | ? $_sKey |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $_sLabel |
196 | 196 | ); |
197 | 197 | } |
198 | - return "<div " . $this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ) . ">" |
|
198 | + return "<div ".$this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ).">" |
|
199 | 199 | . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element. |
200 | 200 | . implode( PHP_EOL, $_aOutput ) |
201 | 201 | . "</div>"; |
@@ -210,12 +210,12 @@ discard block |
||
210 | 210 | */ |
211 | 211 | protected function _getCheckboxContainerAttributes( array $aField ) { |
212 | 212 | return array( |
213 | - 'class' => 'admin-page-framework-checkbox-container-' . $aField[ 'type' ], |
|
213 | + 'class' => 'admin-page-framework-checkbox-container-'.$aField[ 'type' ], |
|
214 | 214 | 'data-select_all_button' => $aField[ 'select_all_button' ] |
215 | - ? ( ! is_string( $aField[ 'select_all_button' ] ) ? $this->oMsg->get( 'select_all' ) : $aField[ 'select_all_button' ] ) |
|
215 | + ? ( !is_string( $aField[ 'select_all_button' ] ) ? $this->oMsg->get( 'select_all' ) : $aField[ 'select_all_button' ] ) |
|
216 | 216 | : null, |
217 | 217 | 'data-select_none_button' => $aField[ 'select_none_button' ] |
218 | - ? ( ! is_string( $aField[ 'select_none_button' ] ) ? $this->oMsg->get( 'select_none' ) : $aField[ 'select_none_button' ] ) |
|
218 | + ? ( !is_string( $aField[ 'select_none_button' ] ) ? $this->oMsg->get( 'select_none' ) : $aField[ 'select_none_button' ] ) |
|
219 | 219 | : null, |
220 | 220 | ); |
221 | 221 | } |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | private function _getEachCheckboxOutput( array $aField, $sKey, $sLabel ) { |
231 | 231 | |
232 | 232 | $_aInputAttributes = array( |
233 | - 'data-key' => $sKey, // 3.8.8+ For the `post_type_taxonomy` field type. |
|
233 | + 'data-key' => $sKey, // 3.8.8+ For the `post_type_taxonomy` field type. |
|
234 | 234 | ) + $aField[ 'attributes' ]; |
235 | 235 | $_oCheckbox = new AdminPageFramework_Input_checkbox( |
236 | 236 | $_aInputAttributes, |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | $_oCheckbox->setAttributesByKey( $sKey ); |
242 | 242 | $_oCheckbox->addClass( $this->_sCheckboxClassSelector ); |
243 | 243 | return $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ) |
244 | - . "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-checkbox-label' ) . ">" |
|
245 | - . "<label " . $this->getAttributes( |
|
244 | + . "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-checkbox-label' ).">" |
|
245 | + . "<label ".$this->getAttributes( |
|
246 | 246 | array( |
247 | 247 | 'for' => $_oCheckbox->getAttribute( 'id' ), |
248 | 248 | 'class' => $_oCheckbox->getAttribute( 'disabled' ) |
@@ -63,16 +63,16 @@ discard block |
||
63 | 63 | * - use_desc_for_title (boolean|int) default is 1 - Whether to use the category description as the title attribute. side note: the framework enables this by default. |
64 | 64 | * @param integer $iCurrentObjectID |
65 | 65 | */ |
66 | - function start_el( &$sOutput, $oTerm, $iDepth=0, $aArgs=array(), $iCurrentObjectID=0 ) { |
|
66 | + function start_el( &$sOutput, $oTerm, $iDepth = 0, $aArgs = array(), $iCurrentObjectID = 0 ) { |
|
67 | 67 | |
68 | 68 | $aArgs = $aArgs + array( |
69 | 69 | '_name_prefix' => null, |
70 | 70 | '_input_id_prefix' => null, |
71 | 71 | '_attributes' => array(), |
72 | 72 | '_selected_items' => array(), |
73 | - 'taxonomy' => null, // parsed by the core function to perform the database query. |
|
74 | - 'disabled' => null, // not sure what this was for |
|
75 | - '_save_unchecked' => true, // 3.8.8+ |
|
73 | + 'taxonomy' => null, // parsed by the core function to perform the database query. |
|
74 | + 'disabled' => null, // not sure what this was for |
|
75 | + '_save_unchecked' => true, // 3.8.8+ |
|
76 | 76 | ); |
77 | 77 | |
78 | 78 | // Local variables |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | // Post count |
86 | 86 | $_sPostCount = $aArgs[ 'show_post_count' ] |
87 | - ? " <span class='font-lighter'>(" . $oTerm->count . ")</span>" |
|
87 | + ? " <span class='font-lighter'>(".$oTerm->count.")</span>" |
|
88 | 88 | : ''; |
89 | 89 | |
90 | 90 | // Attributes |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | + array( |
104 | 104 | 'class' => null, |
105 | 105 | ); |
106 | - $_aInputAttributes['class'] .= ' apf_checkbox'; |
|
106 | + $_aInputAttributes[ 'class' ] .= ' apf_checkbox'; |
|
107 | 107 | |
108 | 108 | $_aLiTagAttributes = array( |
109 | 109 | 'id' => "list-{$_sID}", |
@@ -112,15 +112,15 @@ discard block |
||
112 | 112 | ); |
113 | 113 | |
114 | 114 | $_sHiddenInputForUnchecked = $aArgs[ '_save_unchecked' ] |
115 | - ? "<input value='0' type='hidden' name='" . $_aInputAttributes[ 'name' ] . "' class='apf_checkbox' />" |
|
115 | + ? "<input value='0' type='hidden' name='".$_aInputAttributes[ 'name' ]."' class='apf_checkbox' />" |
|
116 | 116 | : ''; |
117 | 117 | |
118 | 118 | // Output - the variable is by reference so the modification takes effect |
119 | 119 | $sOutput .= "\n" |
120 | - . "<li " . AdminPageFramework_WPUtility::getAttributes( $_aLiTagAttributes ) . ">" |
|
120 | + . "<li ".AdminPageFramework_WPUtility::getAttributes( $_aLiTagAttributes ).">" |
|
121 | 121 | . "<label for='{$_sID}' class='taxonomy-checklist-label'>" |
122 | 122 | . $_sHiddenInputForUnchecked // 3.8.8+ |
123 | - . "<input " . AdminPageFramework_WPUtility::getAttributes( $_aInputAttributes ) . " />" |
|
123 | + . "<input ".AdminPageFramework_WPUtility::getAttributes( $_aInputAttributes )." />" |
|
124 | 124 | . esc_html( apply_filters( 'the_category', $oTerm->name ) ) |
125 | 125 | . $_sPostCount |
126 | 126 | . "</label>"; |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | /** |
82 | 82 | * Defines the field type slugs used for this field type. |
83 | 83 | */ |
84 | - public $aFieldTypeSlugs = array( 'posttype', ); |
|
84 | + public $aFieldTypeSlugs = array( 'posttype',); |
|
85 | 85 | |
86 | 86 | /** |
87 | 87 | * Defines the default key-values of this field type. |
@@ -89,20 +89,20 @@ discard block |
||
89 | 89 | * @remark $_aDefaultKeys holds shared default key-values defined in the base class. |
90 | 90 | */ |
91 | 91 | protected $aDefaultKeys = array( |
92 | - 'slugs_to_remove' => null, // the default array will be assigned in the rendering method. |
|
92 | + 'slugs_to_remove' => null, // the default array will be assigned in the rendering method. |
|
93 | 93 | /** |
94 | 94 | * Accepts query arguments. For the argument specification, see the arg parameter of get_post_types() function. |
95 | 95 | * See: http://codex.wordpress.org/Function_Reference/get_post_types#Parameters |
96 | 96 | */ |
97 | - 'query' => array(), // 3.2.1+ |
|
98 | - 'operator' => 'and', // 3.2.1+ either 'and' or 'or' |
|
97 | + 'query' => array(), // 3.2.1+ |
|
98 | + 'operator' => 'and', // 3.2.1+ either 'and' or 'or' |
|
99 | 99 | 'attributes' => array( |
100 | 100 | 'size' => 30, |
101 | 101 | 'maxlength' => 400, |
102 | 102 | ), |
103 | - 'select_all_button' => true, // 3.3.0+ to change the label, set the label here |
|
104 | - 'select_none_button' => true, // 3.3.0+ to change the label, set the label here |
|
105 | - 'save_unchecked' => true, // (optional, boolean) 3.8.8+ Whether to store the values of unchecked items. |
|
103 | + 'select_all_button' => true, // 3.3.0+ to change the label, set the label here |
|
104 | + 'select_none_button' => true, // 3.3.0+ to change the label, set the label here |
|
105 | + 'save_unchecked' => true, // (optional, boolean) 3.8.8+ Whether to store the values of unchecked items. |
|
106 | 106 | ); |
107 | 107 | protected $aDefaultRemovingPostTypeSlugs = array( |
108 | 108 | 'revision', |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | protected function getStyles() { |
121 | 121 | $_sParentStyles = parent::getStyles(); |
122 | - return $_sParentStyles . <<<CSSRULES |
|
122 | + return $_sParentStyles.<<<CSSRULES |
|
123 | 123 | /* Posttype Field Type */ |
124 | 124 | .admin-page-framework-field input[type='checkbox'] { |
125 | 125 | margin-right: 0.5em; |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | */ |
147 | 147 | protected function getField( $aField ) { |
148 | 148 | |
149 | - $this->_sCheckboxClassSelector = ''; // disable the checkbox class selector. |
|
149 | + $this->_sCheckboxClassSelector = ''; // disable the checkbox class selector. |
|
150 | 150 | $aField[ 'label' ] = $this->_getPostTypeArrayForChecklist( |
151 | 151 | isset( $aField[ 'slugs_to_remove' ] ) |
152 | 152 | ? $this->getAsArray( $aField[ 'slugs_to_remove' ] ) |
153 | - : $this->aDefaultRemovingPostTypeSlugs, // slugs to remove |
|
153 | + : $this->aDefaultRemovingPostTypeSlugs, // slugs to remove |
|
154 | 154 | $aField[ 'query' ], |
155 | 155 | $aField[ 'operator' ] |
156 | 156 | ); |
@@ -171,11 +171,11 @@ discard block |
||
171 | 171 | * @return array The array holding the elements of installed post types' labels and their slugs except the specified expluding post types. |
172 | 172 | * @internal |
173 | 173 | */ |
174 | - private function _getPostTypeArrayForChecklist( $aSlugsToRemove, $asQueryArgs=array(), $sOperator='and' ) { |
|
174 | + private function _getPostTypeArrayForChecklist( $aSlugsToRemove, $asQueryArgs = array(), $sOperator = 'and' ) { |
|
175 | 175 | |
176 | 176 | $_aPostTypes = array(); |
177 | - foreach( get_post_types( $asQueryArgs, 'objects' ) as $_oPostType ) { |
|
178 | - if ( isset( $_oPostType->name, $_oPostType->label ) ) { |
|
177 | + foreach ( get_post_types( $asQueryArgs, 'objects' ) as $_oPostType ) { |
|
178 | + if ( isset( $_oPostType->name, $_oPostType->label ) ) { |
|
179 | 179 | $_aPostTypes[ $_oPostType->name ] = $_oPostType->label; |
180 | 180 | } |
181 | 181 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | * Defines the field type slugs used for this field type. |
120 | 120 | * @var array |
121 | 121 | */ |
122 | - public $aFieldTypeSlugs = array( 'taxonomy', ); |
|
122 | + public $aFieldTypeSlugs = array( 'taxonomy',); |
|
123 | 123 | |
124 | 124 | /** |
125 | 125 | * Defines the default key-values of this field type. |
@@ -128,41 +128,41 @@ discard block |
||
128 | 128 | * @var array |
129 | 129 | */ |
130 | 130 | protected $aDefaultKeys = array( |
131 | - 'taxonomy_slugs' => 'category', // (array|string) This is for the taxonomy field type. |
|
132 | - 'height' => '250px', // the tab box height |
|
133 | - 'width' => null, // 3.5.7.2+ the tab box width |
|
134 | - 'max_width' => '100%', // for the taxonomy checklist field type, since 2.1.1. |
|
135 | - 'show_post_count' => true, // (boolean) 3.2.0+ whether or not the post count associated with the term should be displayed or not. |
|
131 | + 'taxonomy_slugs' => 'category', // (array|string) This is for the taxonomy field type. |
|
132 | + 'height' => '250px', // the tab box height |
|
133 | + 'width' => null, // 3.5.7.2+ the tab box width |
|
134 | + 'max_width' => '100%', // for the taxonomy checklist field type, since 2.1.1. |
|
135 | + 'show_post_count' => true, // (boolean) 3.2.0+ whether or not the post count associated with the term should be displayed or not. |
|
136 | 136 | 'attributes' => array(), |
137 | - 'select_all_button' => true, // (boolean|string) 3.3.0+ to change the label, set the label here |
|
138 | - 'select_none_button' => true, // (boolean|string) 3.3.0+ to change the label, set the label here |
|
139 | - 'label_no_term_found' => null, // (string) 3.3.2+ The label to display when no term is found. null needs to be set here as the default value will be assigned in the field output method. |
|
140 | - 'label_list_title' => '', // (string) 3.3.2+ The heading title string for a term list. Default: `''`. Insert an HTML custom string right before the list starts. |
|
137 | + 'select_all_button' => true, // (boolean|string) 3.3.0+ to change the label, set the label here |
|
138 | + 'select_none_button' => true, // (boolean|string) 3.3.0+ to change the label, set the label here |
|
139 | + 'label_no_term_found' => null, // (string) 3.3.2+ The label to display when no term is found. null needs to be set here as the default value will be assigned in the field output method. |
|
140 | + 'label_list_title' => '', // (string) 3.3.2+ The heading title string for a term list. Default: `''`. Insert an HTML custom string right before the list starts. |
|
141 | 141 | 'query' => array( // (array) 3.3.2+ Defines the default query argument. |
142 | 142 | // see the arguments of the get_category() function: http://codex.wordpress.org/Function_Reference/get_categories |
143 | 143 | // see the argument of the get_terms() function: http://codex.wordpress.org/Function_Reference/get_terms |
144 | 144 | 'child_of' => 0, |
145 | 145 | 'parent' => '', |
146 | - 'orderby' => 'name', // (string) 'ID' or 'term_id' or 'name' |
|
147 | - 'order' => 'ASC', // (string) 'ASC' or 'DESC' |
|
148 | - 'hide_empty' => false, // (boolean) whether to show the terms with no post associated. Default: false |
|
149 | - 'hierarchical' => true, // (boolean) whether to show the terms as a hierarchical tree. |
|
150 | - 'number' => '', // (integer) The maximum number of the terms to show. |
|
151 | - 'pad_counts' => false, // (boolean) whether to sum up the post counts with the child post counts. |
|
152 | - 'exclude' => array(), // (string) Comma separated term IDs to exclude from the list. for example `1` will remove the 'Uncategorized' category from the list. |
|
146 | + 'orderby' => 'name', // (string) 'ID' or 'term_id' or 'name' |
|
147 | + 'order' => 'ASC', // (string) 'ASC' or 'DESC' |
|
148 | + 'hide_empty' => false, // (boolean) whether to show the terms with no post associated. Default: false |
|
149 | + 'hierarchical' => true, // (boolean) whether to show the terms as a hierarchical tree. |
|
150 | + 'number' => '', // (integer) The maximum number of the terms to show. |
|
151 | + 'pad_counts' => false, // (boolean) whether to sum up the post counts with the child post counts. |
|
152 | + 'exclude' => array(), // (string) Comma separated term IDs to exclude from the list. for example `1` will remove the 'Uncategorized' category from the list. |
|
153 | 153 | 'exclude_tree' => array(), |
154 | - 'include' => array(), // (string) Comma separated term IDs to include in the list. |
|
154 | + 'include' => array(), // (string) Comma separated term IDs to include in the list. |
|
155 | 155 | 'fields' => 'all', |
156 | 156 | 'slug' => '', |
157 | 157 | 'get' => '', |
158 | 158 | 'name__like' => '', |
159 | 159 | 'description__like' => '', |
160 | 160 | 'offset' => '', |
161 | - 'search' => '', // (string) The search keyword to get the term with. |
|
161 | + 'search' => '', // (string) The search keyword to get the term with. |
|
162 | 162 | 'cache_domain' => 'core', |
163 | 163 | ), |
164 | - 'queries' => array(), // (optional, array) 3.3.2+ Sets a query argument for each taxonomy. The array key must be the taxonomy slug and the value is the query argument array. |
|
165 | - 'save_unchecked' => true, // (optional, boolean) 3.8.8+ Whether to store the values of unchecked items. |
|
164 | + 'queries' => array(), // (optional, array) 3.3.2+ Sets a query argument for each taxonomy. The array key must be the taxonomy slug and the value is the query argument array. |
|
165 | + 'save_unchecked' => true, // (optional, boolean) 3.8.8+ Whether to store the values of unchecked items. |
|
166 | 166 | ); |
167 | 167 | |
168 | 168 | /** |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | |
193 | 193 | $_aJSArray = json_encode( $this->aFieldTypeSlugs ); |
194 | 194 | |
195 | - return parent::getScripts() . |
|
195 | + return parent::getScripts(). |
|
196 | 196 | // return |
197 | 197 | <<<JAVASCRIPTS |
198 | 198 | /* For tabs */ |
@@ -413,22 +413,22 @@ discard block |
||
413 | 413 | // Parse |
414 | 414 | $_aTabs = array(); |
415 | 415 | $_aCheckboxes = array(); |
416 | - foreach( $this->getAsArray( $aField[ 'taxonomy_slugs' ] ) as $_isKey => $_sTaxonomySlug ) { |
|
416 | + foreach ( $this->getAsArray( $aField[ 'taxonomy_slugs' ] ) as $_isKey => $_sTaxonomySlug ) { |
|
417 | 417 | $_aAssociatedDataAttributes = $this->_getDataAttributesOfAssociatedPostTypes( |
418 | 418 | $_sTaxonomySlug, |
419 | 419 | $this->_getPostTypesByTaxonomySlug( $_sTaxonomySlug ) |
420 | 420 | ); |
421 | - $_aTabs[] = $this->_getTaxonomyTab( $aField, $_isKey, $_sTaxonomySlug, $_aAssociatedDataAttributes ); |
|
422 | - $_aCheckboxes[] = $this->_getTaxonomyCheckboxes( $aField, $_isKey, $_sTaxonomySlug, $_aAssociatedDataAttributes ); |
|
421 | + $_aTabs[ ] = $this->_getTaxonomyTab( $aField, $_isKey, $_sTaxonomySlug, $_aAssociatedDataAttributes ); |
|
422 | + $_aCheckboxes[ ] = $this->_getTaxonomyCheckboxes( $aField, $_isKey, $_sTaxonomySlug, $_aAssociatedDataAttributes ); |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | // Output |
426 | - return "<div id='tabbox-{$aField['field_id']}' class='tab-box-container categorydiv' style='max-width:{$aField['max_width']};'>" |
|
426 | + return "<div id='tabbox-{$aField[ 'field_id' ]}' class='tab-box-container categorydiv' style='max-width:{$aField[ 'max_width' ]};'>" |
|
427 | 427 | . "<ul class='tab-box-tabs category-tabs'>" |
428 | 428 | . implode( PHP_EOL, $_aTabs ) |
429 | 429 | . "</ul>" |
430 | 430 | . "<div class='tab-box-contents-container'>" |
431 | - . "<div class='tab-box-contents' style='height: {$aField['height']};'>" |
|
431 | + . "<div class='tab-box-contents' style='height: {$aField[ 'height' ]};'>" |
|
432 | 432 | . implode( PHP_EOL, $_aCheckboxes ) |
433 | 433 | . "</div>" |
434 | 434 | . "</div>" |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | private function _getDataAttributesOfAssociatedPostTypes( $sTaxonomySlusg, $aPostTypes ) { |
455 | 455 | return array( |
456 | 456 | 'data-associated-with' => $sTaxonomySlusg, |
457 | - 'data-associated-post-types' => implode( ',', $aPostTypes ) . ',', // must add a trailing comma for jQuery to detect the item. |
|
457 | + 'data-associated-post-types' => implode( ',', $aPostTypes ).',', // must add a trailing comma for jQuery to detect the item. |
|
458 | 458 | ); |
459 | 459 | } |
460 | 460 | |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | private function _getTaxonomyCheckboxes( array $aField, $sKey, $sTaxonomySlug, $aAttributes ) { |
470 | 470 | |
471 | 471 | $_aTabBoxContainerArguments = array( |
472 | - 'id' => "tab_{$aField['input_id']}_{$sKey}", |
|
472 | + 'id' => "tab_{$aField[ 'input_id' ]}_{$sKey}", |
|
473 | 473 | 'class' => 'tab-box-content', |
474 | 474 | 'style' => $this->generateInlineCSS( |
475 | 475 | array( |
@@ -478,9 +478,9 @@ discard block |
||
478 | 478 | ) |
479 | 479 | ), |
480 | 480 | ) + $aAttributes; |
481 | - return "<div " . $this->getAttributes( $_aTabBoxContainerArguments ) . ">" |
|
481 | + return "<div ".$this->getAttributes( $_aTabBoxContainerArguments ).">" |
|
482 | 482 | . $this->getElement( $aField, array( 'before_label', $sKey ) ) |
483 | - . "<div " . $this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ) . ">" |
|
483 | + . "<div ".$this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ).">" |
|
484 | 484 | . "</div>" |
485 | 485 | . "<ul class='list:category taxonomychecklist form-no-clear'>" |
486 | 486 | . $this->_getTaxonomyChecklist( $aField, $sKey, $sTaxonomySlug ) |
@@ -505,7 +505,7 @@ discard block |
||
505 | 505 | 'taxonomy' => $sTaxonomySlug, |
506 | 506 | '_name_prefix' => is_array( $aField[ 'taxonomy_slugs' ] ) |
507 | 507 | ? "{$aField[ '_input_name' ]}[{$sTaxonomySlug}]" |
508 | - : $aField[ '_input_name' ], // name prefix of the input |
|
508 | + : $aField[ '_input_name' ], // name prefix of the input |
|
509 | 509 | '_input_id_prefix' => $aField[ 'input_id' ], |
510 | 510 | '_attributes' => $this->getElementAsArray( |
511 | 511 | $aField, |
@@ -513,12 +513,12 @@ discard block |
||
513 | 513 | ) + $aField[ 'attributes' ], |
514 | 514 | |
515 | 515 | // checked items ( term IDs ) e.g. array( 6, 10, 7, 15 ), |
516 | - '_selected_items' => $this->_getSelectedKeyArray( $aField['value'], $sTaxonomySlug ), |
|
516 | + '_selected_items' => $this->_getSelectedKeyArray( $aField[ 'value' ], $sTaxonomySlug ), |
|
517 | 517 | |
518 | - 'echo' => false, // returns the output |
|
519 | - 'show_post_count' => $aField[ 'show_post_count' ], // 3.2.0+ |
|
520 | - 'show_option_none' => $aField[ 'label_no_term_found' ], // 3.3.2+ |
|
521 | - 'title_li' => $aField[ 'label_list_title' ], // 3.3.2+ |
|
518 | + 'echo' => false, // returns the output |
|
519 | + 'show_post_count' => $aField[ 'show_post_count' ], // 3.2.0+ |
|
520 | + 'show_option_none' => $aField[ 'label_no_term_found' ], // 3.3.2+ |
|
521 | + 'title_li' => $aField[ 'label_list_title' ], // 3.3.2+ |
|
522 | 522 | |
523 | 523 | '_save_unchecked' => $aField[ 'save_unchecked' ], // 3.8.8+ Whether to insert hidden input element for unchecked. |
524 | 524 | ) |
@@ -565,8 +565,8 @@ discard block |
||
565 | 565 | $_aLiAttribues = array( |
566 | 566 | 'class' => 'tab-box-tab', |
567 | 567 | ) + $aAttributes; |
568 | - return "<li " . $this->getAttributes( $_aLiAttribues ) . ">" |
|
569 | - . "<a href='#tab_{$aField['input_id']}_{$sKey}'>" |
|
568 | + return "<li ".$this->getAttributes( $_aLiAttribues ).">" |
|
569 | + . "<a href='#tab_{$aField[ 'input_id' ]}_{$sKey}'>" |
|
570 | 570 | . "<span class='tab-box-tab-text'>" |
571 | 571 | . $this->_getLabelFromTaxonomySlug( $sTaxonomySlug ) |
572 | 572 | . "</span>" |
@@ -441,7 +441,7 @@ |
||
441 | 441 | * @since 3.8.8 |
442 | 442 | * @return array Post type slugs associated with the given taxonomy. |
443 | 443 | */ |
444 | - private function _getPostTypesByTaxonomySlug( $sTaxonomySlug ) { |
|
444 | + private function _getPostTypesByTaxonomySlug( $sTaxonomySlug ) { |
|
445 | 445 | $_oTaxonomy = get_taxonomy( $sTaxonomySlug ); |
446 | 446 | return $_oTaxonomy->object_type; |
447 | 447 | } |
@@ -74,6 +74,8 @@ discard block |
||
74 | 74 | * <li>a base64-encoded SVG using a data URI, which will be colored to match the color scheme. This should begin with 'data:image/svg+xml;base64,'.</li> |
75 | 75 | * </ul> |
76 | 76 | * @param string (optional) the position number that is passed to the <var>$position</var> parameter of the <a href="http://codex.wordpress.org/Function_Reference/add_menu_page">add_menu_page()</a> function. |
77 | + * @param string $sIcon16x16 |
|
78 | + * @param integer $iMenuPosition |
|
77 | 79 | * @return void |
78 | 80 | */ |
79 | 81 | public function setRootMenuPage( $sRootMenuLabel, $sIcon16x16=null, $iMenuPosition=null ) { |
@@ -96,6 +98,7 @@ discard block |
||
96 | 98 | * |
97 | 99 | * @since 2.0.0 |
98 | 100 | * @internal |
101 | + * @param string $sMenuLabel |
|
99 | 102 | * @return void|string Returns the associated slug string, if true. |
100 | 103 | */ |
101 | 104 | private function _isBuiltInMenuItem( $sMenuLabel ) { |
@@ -160,9 +163,6 @@ discard block |
||
160 | 163 | * @since 3.0.0 Changed the scope to public. |
161 | 164 | * @remark The sub menu page slug should be unique because add_submenu_page() can add one callback per page slug. |
162 | 165 | * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
163 | - * @param array $aSubMenuItem1 a first sub-menu array. A sub-menu array can be a link or a page. For the specifications of the array structures and its arguments, refer to the parameter section of the `addSubMenuItem()` method. |
|
164 | - * @param array $aSubMenuItem2 (optional) a second sub-menu array. |
|
165 | - * @param array $_and_more (optional) a third and add items as many as necessary with next parameters. |
|
166 | 166 | * @access public |
167 | 167 | * @return void |
168 | 168 | */ |
@@ -250,20 +250,20 @@ |
||
250 | 250 | } |
251 | 251 | |
252 | 252 | /** |
253 | - * Adds the given link into the menu on the left sidebar of the administration panel. |
|
254 | - * |
|
255 | - * @since 2.0.0 |
|
256 | - * @since 3.0.0 Changed the scope to public from protected. |
|
257 | - * @since 3.5.0 Changed the scope to public as it was still protected. |
|
258 | - * @param string the menu title. |
|
259 | - * @param string the URL linked to the menu. |
|
260 | - * @param string (optional) the <a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">access level</a>. |
|
261 | - * @param string (optional) the order number. The larger it is, the lower the position it gets. |
|
262 | - * @param string (optional) if set to false, the menu title will not be listed in the tab navigation menu at the top of the page. |
|
263 | - * @access public |
|
264 | - * @return void |
|
265 | - * @internal |
|
266 | - */ |
|
253 | + * Adds the given link into the menu on the left sidebar of the administration panel. |
|
254 | + * |
|
255 | + * @since 2.0.0 |
|
256 | + * @since 3.0.0 Changed the scope to public from protected. |
|
257 | + * @since 3.5.0 Changed the scope to public as it was still protected. |
|
258 | + * @param string the menu title. |
|
259 | + * @param string the URL linked to the menu. |
|
260 | + * @param string (optional) the <a href="http://codex.wordpress.org/Roles_and_Capabilities" target="_blank">access level</a>. |
|
261 | + * @param string (optional) the order number. The larger it is, the lower the position it gets. |
|
262 | + * @param string (optional) if set to false, the menu title will not be listed in the tab navigation menu at the top of the page. |
|
263 | + * @access public |
|
264 | + * @return void |
|
265 | + * @internal |
|
266 | + */ |
|
267 | 267 | public function addSubMenuLink( array $aSubMenuLink ) { |
268 | 268 | |
269 | 269 | // If required keys are not set, return. |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | * @param string (optional) the position number that is passed to the <var>$position</var> parameter of the <a href="http://codex.wordpress.org/Function_Reference/add_menu_page">add_menu_page()</a> function. |
77 | 77 | * @return void |
78 | 78 | */ |
79 | - public function setRootMenuPage( $sRootMenuLabel, $sIcon16x16=null, $iMenuPosition=null ) { |
|
79 | + public function setRootMenuPage( $sRootMenuLabel, $sIcon16x16 = null, $iMenuPosition = null ) { |
|
80 | 80 | |
81 | 81 | $sRootMenuLabel = trim( $sRootMenuLabel ); |
82 | 82 | $_sSlug = $this->_isBuiltInMenuItem( $sRootMenuLabel ); // if true, this method returns the slug |
@@ -267,16 +267,16 @@ discard block |
||
267 | 267 | public function addSubMenuLink( array $aSubMenuLink ) { |
268 | 268 | |
269 | 269 | // If required keys are not set, return. |
270 | - if ( ! isset( $aSubMenuLink[ 'href' ], $aSubMenuLink[ 'title' ] ) ) { |
|
270 | + if ( !isset( $aSubMenuLink[ 'href' ], $aSubMenuLink[ 'title' ] ) ) { |
|
271 | 271 | return; |
272 | 272 | } |
273 | 273 | |
274 | 274 | // If the set URL is not valid, return. |
275 | - if ( ! filter_var( $aSubMenuLink[ 'href' ], FILTER_VALIDATE_URL ) ) { |
|
275 | + if ( !filter_var( $aSubMenuLink[ 'href' ], FILTER_VALIDATE_URL ) ) { |
|
276 | 276 | return; |
277 | 277 | } |
278 | 278 | |
279 | - $_oFormatter = new AdminPageFramework_Format_SubMenuLink( |
|
279 | + $_oFormatter = new AdminPageFramework_Format_SubMenuLink( |
|
280 | 280 | $aSubMenuLink, |
281 | 281 | $this, |
282 | 282 | count( $this->oProp->aPages ) + 1 |
@@ -334,11 +334,11 @@ discard block |
||
334 | 334 | */ |
335 | 335 | public function addSubMenuPage( array $aSubMenuPage ) { |
336 | 336 | |
337 | - if ( ! isset( $aSubMenuPage[ 'page_slug' ] ) ) { |
|
337 | + if ( !isset( $aSubMenuPage[ 'page_slug' ] ) ) { |
|
338 | 338 | return; |
339 | 339 | } |
340 | 340 | |
341 | - $_oFormatter = new AdminPageFramework_Format_SubMenuPage( |
|
341 | + $_oFormatter = new AdminPageFramework_Format_SubMenuPage( |
|
342 | 342 | $aSubMenuPage, |
343 | 343 | $this, |
344 | 344 | count( $this->oProp->aPages ) + 1 |
@@ -267,12 +267,12 @@ discard block |
||
267 | 267 | public function addSubMenuLink( array $aSubMenuLink ) { |
268 | 268 | |
269 | 269 | // If required keys are not set, return. |
270 | - if ( ! isset( $aSubMenuLink[ 'href' ], $aSubMenuLink[ 'title' ] ) ) { |
|
270 | + if ( ! isset( $aSubMenuLink[ 'href' ], $aSubMenuLink[ 'title' ] ) ) { |
|
271 | 271 | return; |
272 | 272 | } |
273 | 273 | |
274 | 274 | // If the set URL is not valid, return. |
275 | - if ( ! filter_var( $aSubMenuLink[ 'href' ], FILTER_VALIDATE_URL ) ) { |
|
275 | + if ( ! filter_var( $aSubMenuLink[ 'href' ], FILTER_VALIDATE_URL ) ) { |
|
276 | 276 | return; |
277 | 277 | } |
278 | 278 | |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | */ |
335 | 335 | public function addSubMenuPage( array $aSubMenuPage ) { |
336 | 336 | |
337 | - if ( ! isset( $aSubMenuPage[ 'page_slug' ] ) ) { |
|
337 | + if ( ! isset( $aSubMenuPage[ 'page_slug' ] ) ) { |
|
338 | 338 | return; |
339 | 339 | } |
340 | 340 |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | * @package AdminPageFramework |
11 | 11 | */ |
12 | 12 | |
13 | -if ( ! class_exists( 'AdminPageFramework_Registry', false ) ) : |
|
13 | +if ( !class_exists( 'AdminPageFramework_Registry', false ) ) : |
|
14 | 14 | /** |
15 | 15 | * Facilitates WordPress plugin and theme development. |
16 | 16 | * |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | final class AdminPageFramework_Registry extends AdminPageFramework_Registry_Base { |
62 | 62 | |
63 | 63 | const TEXT_DOMAIN = 'admin-page-framework'; |
64 | - const TEXT_DOMAIN_PATH = '/language'; // not used at the moment |
|
64 | + const TEXT_DOMAIN_PATH = '/language'; // not used at the moment |
|
65 | 65 | |
66 | 66 | /** |
67 | 67 | * Indicates whether the framework is loaded from the minified version or not. |
@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | * Sets up static properties. |
104 | 104 | * @return void |
105 | 105 | */ |
106 | - static public function setUp( $sFilePath=__FILE__ ) { |
|
106 | + static public function setUp( $sFilePath = __FILE__ ) { |
|
107 | 107 | |
108 | 108 | self::$sFilePath = $sFilePath; |
109 | 109 | self::$sDirPath = dirname( self::$sFilePath ); |
110 | - self::$sIncludeClassListPath = self::$sDirPath . '/admin-page-framework-include-class-list.php'; |
|
110 | + self::$sIncludeClassListPath = self::$sDirPath.'/admin-page-framework-include-class-list.php'; |
|
111 | 111 | self::$aClassFiles = self::_getClassFilePathList( self::$sIncludeClassListPath ); |
112 | 112 | self::$sAutoLoaderPath = isset( self::$aClassFiles[ 'AdminPageFramework_RegisterClasses' ] ) |
113 | 113 | ? self::$aClassFiles[ 'AdminPageFramework_RegisterClasses' ] |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @return array |
123 | 123 | */ |
124 | 124 | static private function _getClassFilePathList( $sInclusionClassListPath ) { |
125 | - $aClassFiles = array(); // this will be updated if the inclusion below is successful. |
|
125 | + $aClassFiles = array(); // this will be updated if the inclusion below is successful. |
|
126 | 126 | include( $sInclusionClassListPath ); |
127 | 127 | return $aClassFiles; |
128 | 128 | } |
@@ -135,11 +135,11 @@ discard block |
||
135 | 135 | */ |
136 | 136 | static public function getVersion() { |
137 | 137 | |
138 | - if ( ! isset( self::$sAutoLoaderPath ) ) { |
|
139 | - trigger_error( self::NAME . ': ' . ' : ' . sprintf( __( 'The method is called too early. Perform <code>%2$s</code> earlier.', 'admin-page-framework' ), __METHOD__, 'setUp()' ), E_USER_WARNING ); |
|
138 | + if ( !isset( self::$sAutoLoaderPath ) ) { |
|
139 | + trigger_error( self::NAME.': '.' : '.sprintf( __( 'The method is called too early. Perform <code>%2$s</code> earlier.', 'admin-page-framework' ), __METHOD__, 'setUp()' ), E_USER_WARNING ); |
|
140 | 140 | return self::VERSION; |
141 | 141 | } |
142 | - $_aMinifiedVesionSuffix = array( |
|
142 | + $_aMinifiedVesionSuffix = array( |
|
143 | 143 | 0 => '', |
144 | 144 | 1 => '.min', |
145 | 145 | ); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | } |
169 | 169 | endif; |
170 | 170 | |
171 | -if ( ! class_exists( 'AdminPageFramework_Bootstrap', false ) ) : |
|
171 | +if ( !class_exists( 'AdminPageFramework_Bootstrap', false ) ) : |
|
172 | 172 | /** |
173 | 173 | * Loads the Admin Page Framework library. |
174 | 174 | * |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | */ |
190 | 190 | public function __construct( $sLibraryPath ) { |
191 | 191 | |
192 | - if ( ! $this->_isLoadable() ) { |
|
192 | + if ( !$this->_isLoadable() ) { |
|
193 | 193 | return; |
194 | 194 | } |
195 | 195 |
@@ -29,38 +29,38 @@ discard block |
||
29 | 29 | static public $aStructure = array( |
30 | 30 | |
31 | 31 | // Required Keys |
32 | - 'field_id' => null, // (string) |
|
33 | - 'section_id' => null, // (string) |
|
32 | + 'field_id' => null, // (string) |
|
33 | + 'section_id' => null, // (string) |
|
34 | 34 | |
35 | 35 | // Optional Keys |
36 | - 'type' => null, // (string) (3.8.0+ Became okay to omit.) |
|
37 | - 'section_title' => null, // This will be assigned automatically in the formatting method. |
|
38 | - 'page_slug' => null, // This will be assigned automatically in the formatting method. |
|
39 | - 'tab_slug' => null, // This will be assigned automatically in the formatting method. |
|
40 | - 'option_key' => null, // This will be assigned automatically in the formatting method. |
|
41 | - 'class_name' => null, // Stores the instantiated class name. Used by the export field type. Also a third party custom field type uses it. |
|
36 | + 'type' => null, // (string) (3.8.0+ Became okay to omit.) |
|
37 | + 'section_title' => null, // This will be assigned automatically in the formatting method. |
|
38 | + 'page_slug' => null, // This will be assigned automatically in the formatting method. |
|
39 | + 'tab_slug' => null, // This will be assigned automatically in the formatting method. |
|
40 | + 'option_key' => null, // This will be assigned automatically in the formatting method. |
|
41 | + 'class_name' => null, // Stores the instantiated class name. Used by the export field type. Also a third party custom field type uses it. |
|
42 | 42 | 'capability' => null, |
43 | 43 | 'title' => null, |
44 | 44 | 'tip' => null, |
45 | 45 | 'description' => null, |
46 | - 'error_message' => null, // error message for the field |
|
46 | + 'error_message' => null, // error message for the field |
|
47 | 47 | 'before_label' => null, |
48 | 48 | 'after_label' => null, |
49 | 49 | 'if' => true, |
50 | - 'order' => null, // do not set the default number here for this key. |
|
50 | + 'order' => null, // do not set the default number here for this key. |
|
51 | 51 | 'default' => null, |
52 | 52 | 'value' => null, |
53 | - 'help' => null, // 2.1.0 |
|
54 | - 'help_aside' => null, // 2.1.0 |
|
55 | - 'repeatable' => null, // 2.1.3 |
|
56 | - 'sortable' => null, // 2.1.3 |
|
57 | - 'show_title_column' => true, // 3.0.0 |
|
58 | - 'hidden' => null, // 3.0.0 |
|
53 | + 'help' => null, // 2.1.0 |
|
54 | + 'help_aside' => null, // 2.1.0 |
|
55 | + 'repeatable' => null, // 2.1.3 |
|
56 | + 'sortable' => null, // 2.1.3 |
|
57 | + 'show_title_column' => true, // 3.0.0 |
|
58 | + 'hidden' => null, // 3.0.0 |
|
59 | 59 | |
60 | - 'placement' => 'normal', // 3.8.0 (string) accepts either 'section_title', 'field_title', or 'normal' |
|
60 | + 'placement' => 'normal', // 3.8.0 (string) accepts either 'section_title', 'field_title', or 'normal' |
|
61 | 61 | |
62 | 62 | // @todo Examine why an array is not set but null here for the attributes argument. |
63 | - 'attributes' => null, // 3.0.0 - the array represents the attributes of input tag |
|
63 | + 'attributes' => null, // 3.0.0 - the array represents the attributes of input tag |
|
64 | 64 | 'class' => array( // 3.3.1 |
65 | 65 | 'fieldrow' => array(), |
66 | 66 | 'fieldset' => array(), |
@@ -68,29 +68,29 @@ discard block |
||
68 | 68 | 'field' => array(), |
69 | 69 | ), |
70 | 70 | |
71 | - 'save' => true, // 3.6.0 |
|
72 | - 'content' => null, // 3.6.1 - (string) An overriding field-set output. |
|
71 | + 'save' => true, // 3.6.0 |
|
72 | + 'content' => null, // 3.6.1 - (string) An overriding field-set output. |
|
73 | 73 | |
74 | - 'show_debug_info' => null, // 3.8.8+ (boolean) whether to show debug information such as field definition tool-tips. This value is inherited from the section definition argument of the same name. Not setting a value here as it is determined with another calculated value. |
|
74 | + 'show_debug_info' => null, // 3.8.8+ (boolean) whether to show debug information such as field definition tool-tips. This value is inherited from the section definition argument of the same name. Not setting a value here as it is determined with another calculated value. |
|
75 | 75 | |
76 | 76 | // Internal Keys |
77 | - '_fields_type' => null, // @deprecated 3.7.0, 3.0.0 - an internal key that indicates the fields type such as page, meta box for pages, meta box for posts, or taxonomy. |
|
78 | - '_structure_type' => null, // 3.7.0 |
|
79 | - '_caller_object' => null, // 3.4.0 (object) stores the object of the caller class. The object is referenced when creating nested fields. |
|
77 | + '_fields_type' => null, // @deprecated 3.7.0, 3.0.0 - an internal key that indicates the fields type such as page, meta box for pages, meta box for posts, or taxonomy. |
|
78 | + '_structure_type' => null, // 3.7.0 |
|
79 | + '_caller_object' => null, // 3.4.0 (object) stores the object of the caller class. The object is referenced when creating nested fields. |
|
80 | 80 | |
81 | - '_section_path' => '', // 3.7.0 (string) Stores the section path that indicates the structural address of the nested section. e.g. my_section|nested_one |
|
82 | - '_section_path_array' => '', // 3.7.0 (array) An array version of the above section path. |
|
83 | - '_nested_depth' => 0, // 3.4.0 (integer) stores the level of the nesting depth. This is mostly used for debugging by checking if the field is a nested field or not. |
|
84 | - '_subsection_index' => null, // 3.7.0 Passed to the `field_definition_{...}` filter hook callbacks. |
|
85 | - '_section_repeatable' => false, // @deprecated |
|
86 | - '_is_section_repeatable' => false, // 3.8.0 (boolean) Whether the belonging section is repeatable or not. |
|
81 | + '_section_path' => '', // 3.7.0 (string) Stores the section path that indicates the structural address of the nested section. e.g. my_section|nested_one |
|
82 | + '_section_path_array' => '', // 3.7.0 (array) An array version of the above section path. |
|
83 | + '_nested_depth' => 0, // 3.4.0 (integer) stores the level of the nesting depth. This is mostly used for debugging by checking if the field is a nested field or not. |
|
84 | + '_subsection_index' => null, // 3.7.0 Passed to the `field_definition_{...}` filter hook callbacks. |
|
85 | + '_section_repeatable' => false, // @deprecated |
|
86 | + '_is_section_repeatable' => false, // 3.8.0 (boolean) Whether the belonging section is repeatable or not. |
|
87 | 87 | |
88 | - '_field_path' => '', // 3.7.0 (string) Stores the field path that indicates the structural location of the field. This is relative to the belonging section. |
|
88 | + '_field_path' => '', // 3.7.0 (string) Stores the field path that indicates the structural location of the field. This is relative to the belonging section. |
|
89 | 89 | '_field_path_array' => array(), // 3.7.0 (array) An array version of the above field path. |
90 | - '_parent_field_path' => '', // 3.8.0 (string) |
|
90 | + '_parent_field_path' => '', // 3.8.0 (string) |
|
91 | 91 | '_parent_field_path_array' => array(), // 3.8.0 (array) |
92 | 92 | |
93 | - '_is_title_embedded' => false, // 3.8.0 (boolean) whether the field title is in the fieldset element, not in the table th element. This becomes `true` for `section_title` fields and fields with the `placement` argument with the value of `section_title` or `field_title`. |
|
93 | + '_is_title_embedded' => false, // 3.8.0 (boolean) whether the field title is in the fieldset element, not in the table th element. This becomes `true` for `section_title` fields and fields with the `placement` argument with the value of `section_title` or `field_title`. |
|
94 | 94 | |
95 | 95 | ); |
96 | 96 | |
@@ -167,14 +167,14 @@ discard block |
||
167 | 167 | array( |
168 | 168 | '_fields_type' => $this->sStructureType, // @deprecated 3.7.0 backward-compatibility |
169 | 169 | '_structure_type' => $this->sStructureType, |
170 | - '_caller_object' => $this->oCallerObject, // 3.4.1+ Stores the caller form object. |
|
171 | - '_subsection_index' => $this->iSubSectionIndex, // 3.7.0+ |
|
170 | + '_caller_object' => $this->oCallerObject, // 3.4.1+ Stores the caller form object. |
|
171 | + '_subsection_index' => $this->iSubSectionIndex, // 3.7.0+ |
|
172 | 172 | ) |
173 | 173 | + $this->aFieldset, |
174 | 174 | array( |
175 | 175 | 'capability' => $this->sCapability, |
176 | 176 | 'section_id' => '_default', |
177 | - '_section_repeatable' => $this->bIsSectionRepeatable, // @deprecated 3.8.0 This was not used. |
|
177 | + '_section_repeatable' => $this->bIsSectionRepeatable, // @deprecated 3.8.0 This was not used. |
|
178 | 178 | '_is_section_repeatable' => $this->bIsSectionRepeatable, |
179 | 179 | ) |
180 | 180 | + self::$aStructure |
@@ -295,12 +295,12 @@ discard block |
||
295 | 295 | |
296 | 296 | ); |
297 | 297 | |
298 | - foreach( $aNestedFieldsets as $_isIndex => &$_aNestedFieldset ) { |
|
298 | + foreach ( $aNestedFieldsets as $_isIndex => &$_aNestedFieldset ) { |
|
299 | 299 | |
300 | 300 | // The inline-mixed type has a string element. |
301 | 301 | if ( is_scalar( $_aNestedFieldset ) ) { |
302 | 302 | $_aNestedFieldset = array( |
303 | - 'field_id' => $aParentFieldset[ 'field_id' ] . '_' . uniqid(), |
|
303 | + 'field_id' => $aParentFieldset[ 'field_id' ].'_'.uniqid(), |
|
304 | 304 | 'content' => $_aNestedFieldset, |
305 | 305 | ); |
306 | 306 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | $_aFieldset[ 'class' ] = $this->getAsArray( $_aFieldset[ 'class' ] ); |
196 | 196 | |
197 | 197 | // 3.8.0+ Support nested fields and inline_mized field type. |
198 | - if ( $this->hasFieldDefinitionsInContent( $_aFieldset ) ) { |
|
198 | + if ( $this->hasFieldDefinitionsInContent( $_aFieldset ) ) { |
|
199 | 199 | $_aFieldset[ 'content' ] = $this->_getChildFieldsetsFormatted( $_aFieldset[ 'content' ], $_aFieldset ); |
200 | 200 | } |
201 | 201 | |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | * @since 3.8.8 |
223 | 223 | * @return boolean |
224 | 224 | */ |
225 | - private function _getShowDebugInfo( $aFieldset ) { |
|
225 | + private function _getShowDebugInfo( $aFieldset ) { |
|
226 | 226 | |
227 | 227 | // If the user sets a value. use it. |
228 | 228 | if ( isset( $aFieldset[ 'show_debug_info' ] ) ) { |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | foreach( $aNestedFieldsets as $_isIndex => &$_aNestedFieldset ) { |
299 | 299 | |
300 | 300 | // The inline-mixed type has a string element. |
301 | - if ( is_scalar( $_aNestedFieldset ) ) { |
|
301 | + if ( is_scalar( $_aNestedFieldset ) ) { |
|
302 | 302 | $_aNestedFieldset = array( |
303 | 303 | 'field_id' => $aParentFieldset[ 'field_id' ] . '_' . uniqid(), |
304 | 304 | 'content' => $_aNestedFieldset, |