@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | // For front-end |
86 | 86 | // @see http://wordpress.stackexchange.com/a/82722 |
87 | - if ( ! is_admin() ) { |
|
87 | + if ( !is_admin() ) { |
|
88 | 88 | |
89 | 89 | // wp_enqueue_style( 'wp-color-picker' ); |
90 | 90 | wp_enqueue_script( |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | return array( |
125 | 125 | array( |
126 | 126 | 'handle_id' => 'admin-page-framework-field-type-color', |
127 | - 'src' => dirname( __FILE__ ) . '/js/color.bundle.js', |
|
127 | + 'src' => dirname( __FILE__ ).'/js/color.bundle.js', |
|
128 | 128 | 'in_footer' => true, |
129 | 129 | 'dependencies' => array( 'jquery', 'admin-page-framework-script-form-main' ), |
130 | 130 | 'translation_var' => 'AdminPageFrameworkColorFieldType', |
@@ -149,22 +149,22 @@ discard block |
||
149 | 149 | $aField[ 'attributes' ] = $this->___getInputAttributes( $aField ); |
150 | 150 | return $aField[ 'before_label' ] |
151 | 151 | . "<div class='admin-page-framework-input-label-container'>" |
152 | - . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ] |
|
153 | - ? "<label><span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
152 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
153 | + ? "<label><span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
154 | 154 | . $aField[ 'label' ] |
155 | 155 | . "</span></label>" |
156 | 156 | : "" |
157 | 157 | ) |
158 | 158 | . "<label for='{$aField[ 'input_id' ]}'>" |
159 | 159 | . $aField[ 'before_input' ] |
160 | - . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" |
|
160 | + . "<input ".$this->getAttributes( $aField[ 'attributes' ] )." />" |
|
161 | 161 | . $aField[ 'after_input' ] |
162 | 162 | . "</label>" |
163 | 163 | // this div element with this class selector becomes a farbtastic color picker. ( below 3.4.x ) // rel='{$aField['input_id']}' |
164 | - . "<div class='colorpicker admin-page-framework-field-color-picker' id='color_" . esc_attr( $aField[ 'input_id' ] ) . "' data-input_id='" . esc_attr( $aField[ 'input_id' ] ) . "'></div>" |
|
164 | + . "<div class='colorpicker admin-page-framework-field-color-picker' id='color_".esc_attr( $aField[ 'input_id' ] )."' data-input_id='".esc_attr( $aField[ 'input_id' ] )."'></div>" |
|
165 | 165 | . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element. |
166 | 166 | . "</div>" |
167 | - . $aField['after_label']; |
|
167 | + . $aField[ 'after_label' ]; |
|
168 | 168 | |
169 | 169 | } |
170 | 170 | /** |
@@ -175,13 +175,13 @@ discard block |
||
175 | 175 | private function ___getInputAttributes( array $aField ) { |
176 | 176 | |
177 | 177 | return array( |
178 | - 'color' => $aField['value'], |
|
179 | - 'value' => $aField['value'], |
|
178 | + 'color' => $aField[ 'value' ], |
|
179 | + 'value' => $aField[ 'value' ], |
|
180 | 180 | 'data-default' => isset( $aField[ 'default' ] ) |
181 | 181 | ? $aField[ 'default' ] |
182 | 182 | : 'transparent', // used by the repeatable script |
183 | 183 | 'type' => 'text', // it must be text |
184 | - 'class' => trim( 'input_color ' . $aField['attributes']['class'] ), |
|
184 | + 'class' => trim( 'input_color '.$aField[ 'attributes' ][ 'class' ] ), |
|
185 | 185 | ) + $aField[ 'attributes' ]; |
186 | 186 | |
187 | 187 | } |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | /** |
209 | 209 | * Defines the field type slugs used for this field type. |
210 | 210 | */ |
211 | - public $aFieldTypeSlugs = array( 'table', ); |
|
211 | + public $aFieldTypeSlugs = array( 'table',); |
|
212 | 212 | |
213 | 213 | /** |
214 | 214 | * Defines the default key-values of this field type. |
@@ -220,12 +220,12 @@ discard block |
||
220 | 220 | 'collapsible' => false, |
221 | 221 | 'escape' => false, |
222 | 222 | 'caption' => '', |
223 | - 'header' => array(), // (array) key-value pairs of the table header |
|
224 | - 'footer' => array(), // (array|string) key-value pairs of the table footer. When `USE_HEADER` is passed, the value set to the `header` argument will be applied. |
|
223 | + 'header' => array(), // (array) key-value pairs of the table header |
|
224 | + 'footer' => array(), // (array|string) key-value pairs of the table footer. When `USE_HEADER` is passed, the value set to the `header` argument will be applied. |
|
225 | 225 | |
226 | 226 | // [Not fully implemented] To fully support most use cases, a library like the tablesorter jQuery plugin is big in size. And it is more suitable for a custom field type. |
227 | 227 | // this argument just adds `sortable-column` class selector to specified column index but does nothing yet. |
228 | - 'sortable_column' => array(), // (array) linear array consisting of boolean values indicating which columns should be sortable by matching the array index with the header argument array index. |
|
228 | + 'sortable_column' => array(), // (array) linear array consisting of boolean values indicating which columns should be sortable by matching the array index with the header argument array index. |
|
229 | 229 | ); |
230 | 230 | |
231 | 231 | /** |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | return array( |
237 | 237 | array( |
238 | 238 | 'handle_id' => 'admin-page-framework-field-type-table', |
239 | - 'src' => dirname( __FILE__ ) . '/js/table.bundle.js', |
|
239 | + 'src' => dirname( __FILE__ ).'/js/table.bundle.js', |
|
240 | 240 | 'in_footer' => true, |
241 | 241 | 'dependencies' => array( 'jquery', 'jquery-ui-accordion', 'admin-page-framework-script-form-main' ), |
242 | 242 | 'translation_var' => 'AdminPageFrameworkFieldTypeTable', |
@@ -269,12 +269,12 @@ discard block |
||
269 | 269 | * @return string |
270 | 270 | */ |
271 | 271 | private function ___getLabel( $aField ) { |
272 | - if ( ! strlen( $aField[ 'label' ] ) ) { |
|
272 | + if ( !strlen( $aField[ 'label' ] ) ) { |
|
273 | 273 | return ''; |
274 | 274 | } |
275 | 275 | return "<div class='admin-page-framework-input-label-container'>" |
276 | - . "<label for='" . esc_attr( $aField[ 'input_id' ] ) . "'>" |
|
277 | - . "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
276 | + . "<label for='".esc_attr( $aField[ 'input_id' ] )."'>" |
|
277 | + . "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
278 | 278 | . $aField[ 'label' ] |
279 | 279 | . "</span>" |
280 | 280 | . "</label>" |
@@ -299,9 +299,9 @@ discard block |
||
299 | 299 | if ( empty( $_aCollapsible ) ) { |
300 | 300 | return $this->getTableOfArray( |
301 | 301 | $this->getAsArray( $aField[ 'data' ] ), |
302 | - $_aAttributes, // attributes |
|
303 | - $aField[ 'header' ], // header |
|
304 | - $_aFooter, // footer, |
|
302 | + $_aAttributes, // attributes |
|
303 | + $aField[ 'header' ], // header |
|
304 | + $_aFooter, // footer, |
|
305 | 305 | $aField[ 'escape' ], |
306 | 306 | $aField[ 'caption' ] |
307 | 307 | ); |
@@ -315,16 +315,16 @@ discard block |
||
315 | 315 | ? "<div class='text-content'>{$aField[ 'data' ]}</div>" // this allows to create simple FAQ |
316 | 316 | : $this->getTableOfArray( |
317 | 317 | $this->getAsArray( $aField[ 'data' ] ), |
318 | - $_aAttributes, // attributes, |
|
319 | - $aField[ 'header' ], // header |
|
320 | - $_aFooter, // footer, |
|
318 | + $_aAttributes, // attributes, |
|
319 | + $aField[ 'header' ], // header |
|
320 | + $_aFooter, // footer, |
|
321 | 321 | $aField[ 'escape' ] |
322 | - ); // omit caption |
|
322 | + ); // omit caption |
|
323 | 323 | $_aCollapsible = $this->getAsArray( $_aCollapsible ) + array( 'active' => null ); |
324 | 324 | $_aCollapsible[ 'active' ] = is_numeric( $_aCollapsible[ 'active' ] ) |
325 | 325 | ? ( integer ) $_aCollapsible[ 'active' ] // accepts numeric index values |
326 | - : ( $_aCollapsible[ 'active' ] ? 'true' : 'false' ); // passing a value as string to be parsed properly on the JS side |
|
327 | - return "<div class='accordion-container' " . $this->getDataAttributes( $_aCollapsible ) . ">" |
|
326 | + : ( $_aCollapsible[ 'active' ] ? 'true' : 'false' ); // passing a value as string to be parsed properly on the JS side |
|
327 | + return "<div class='accordion-container' ".$this->getDataAttributes( $_aCollapsible ).">" |
|
328 | 328 | . "<div class='accordion-title'><h4><span>{$_sCaption}</span></h4></div>" |
329 | 329 | . "<div class='accordion-content'>{$_sContent}</div>" |
330 | 330 | . "</div>"; |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | ); |
343 | 343 | |
344 | 344 | // Add sortable header and footer classes |
345 | - foreach( $this->getAsArray( $aField[ 'sortable_column' ] ) as $_iColumnIndex => $_bSortable ) { |
|
345 | + foreach ( $this->getAsArray( $aField[ 'sortable_column' ] ) as $_iColumnIndex => $_bSortable ) { |
|
346 | 346 | if ( empty( $_bSortable ) ) { |
347 | 347 | continue; |
348 | 348 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | /** |
103 | 103 | * Defines the field type slugs used for this field type. |
104 | 104 | */ |
105 | - public $aFieldTypeSlugs = array( 'select', ); |
|
105 | + public $aFieldTypeSlugs = array( 'select',); |
|
106 | 106 | |
107 | 107 | /** |
108 | 108 | * Defines the default key-values of this field type. |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | 'select' => array( |
115 | 115 | 'size' => 1, |
116 | 116 | 'autofocusNew' => null, |
117 | - 'multiple' => null, // set 'multiple' for multiple selections. If 'is_multiple' is set, it takes the precedence. |
|
117 | + 'multiple' => null, // set 'multiple' for multiple selections. If 'is_multiple' is set, it takes the precedence. |
|
118 | 118 | 'required' => null, |
119 | 119 | ), |
120 | 120 | 'optgroup' => array(), |
@@ -154,12 +154,12 @@ discard block |
||
154 | 154 | protected function getField( $aField ) { |
155 | 155 | |
156 | 156 | $_oSelectInput = new AdminPageFramework_Input_select( $aField[ 'attributes' ] ); |
157 | - if ( $aField[ 'is_multiple' ] ) { |
|
157 | + if ( $aField[ 'is_multiple' ] ) { |
|
158 | 158 | $_oSelectInput->setAttribute( array( 'select', 'multiple' ), 'multiple' ); |
159 | 159 | } |
160 | 160 | return |
161 | 161 | $aField[ 'before_label' ] |
162 | - . "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ) . ">" |
|
162 | + . "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-select-label' ).">" |
|
163 | 163 | . "<label for='{$aField[ 'input_id' ]}'>" |
164 | 164 | . $aField[ 'before_input' ] |
165 | 165 | . $_oSelectInput->get( $aField[ 'label' ] ) |
@@ -66,16 +66,16 @@ discard block |
||
66 | 66 | */ |
67 | 67 | protected function getField( $aField ) { |
68 | 68 | |
69 | - $_oCallerForm = $aField[ '_caller_object' ]; |
|
69 | + $_oCallerForm = $aField[ '_caller_object' ]; |
|
70 | 70 | |
71 | 71 | $_aInlineMixedOutput = array(); |
72 | - foreach( $this->getAsArray( $aField[ 'content' ] ) as $_aChildFieldset ) { |
|
72 | + foreach ( $this->getAsArray( $aField[ 'content' ] ) as $_aChildFieldset ) { |
|
73 | 73 | |
74 | 74 | if ( is_scalar( $_aChildFieldset ) ) { |
75 | 75 | continue; |
76 | 76 | } |
77 | 77 | |
78 | - if ( ! $this->isNormalPlacement( $_aChildFieldset ) ) { |
|
78 | + if ( !$this->isNormalPlacement( $_aChildFieldset ) ) { |
|
79 | 79 | continue; |
80 | 80 | } |
81 | 81 | |
@@ -91,12 +91,12 @@ discard block |
||
91 | 91 | $_oFieldset = new AdminPageFramework_Form_View___Fieldset( |
92 | 92 | $_aChildFieldset, |
93 | 93 | $_oCallerForm->aSavedData, |
94 | - $_oCallerForm->getFieldErrors(), // @todo Generate field errors. $this->aErrors, |
|
94 | + $_oCallerForm->getFieldErrors(), // @todo Generate field errors. $this->aErrors, |
|
95 | 95 | $_oCallerForm->aFieldTypeDefinitions, |
96 | 96 | $_oCallerForm->oMsg, |
97 | 97 | $_oCallerForm->aCallbacks // field output element callables. |
98 | 98 | ); |
99 | - $_aInlineMixedOutput[] = $_oFieldset->get(); // field output |
|
99 | + $_aInlineMixedOutput[ ] = $_oFieldset->get(); // field output |
|
100 | 100 | |
101 | 101 | |
102 | 102 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | return array( |
65 | 65 | array( |
66 | 66 | 'handle_id' => 'admin-page-framework-field-type-radio', |
67 | - 'src' => dirname( __FILE__ ) . '/js/radio.bundle.js', |
|
67 | + 'src' => dirname( __FILE__ ).'/js/radio.bundle.js', |
|
68 | 68 | 'in_footer' => true, |
69 | 69 | 'dependencies' => array( 'jquery', 'admin-page-framework-script-form-main' ), |
70 | 70 | 'translation_var' => 'AdminPageFrameworkFieldTypeRadio', |
@@ -86,9 +86,9 @@ discard block |
||
86 | 86 | * @return string |
87 | 87 | */ |
88 | 88 | protected function getField( $aField ) { |
89 | - $_aOutput = array(); |
|
90 | - foreach( $this->getAsArray( $aField[ 'label' ] ) as $_sKey => $_sLabel ) { |
|
91 | - $_aOutput[] = $this->___getEachRadioButtonOutput( $aField, $_sKey, $_sLabel ); |
|
89 | + $_aOutput = array(); |
|
90 | + foreach ( $this->getAsArray( $aField[ 'label' ] ) as $_sKey => $_sLabel ) { |
|
91 | + $_aOutput[ ] = $this->___getEachRadioButtonOutput( $aField, $_sKey, $_sLabel ); |
|
92 | 92 | } |
93 | 93 | return implode( PHP_EOL, $_aOutput ); |
94 | 94 | } |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | |
109 | 109 | // Output |
110 | 110 | return $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ) |
111 | - . "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-radio-label' ) . ">" |
|
112 | - . "<label " . $this->getAttributes( |
|
111 | + . "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-radio-label' ).">" |
|
112 | + . "<label ".$this->getAttributes( |
|
113 | 113 | array( |
114 | 114 | 'for' => $_oRadio->getAttribute( 'id' ), |
115 | 115 | 'class' => $_oRadio->getAttribute( 'disabled' ) |
@@ -217,8 +217,8 @@ |
||
217 | 217 | * @remark $_aDefaultKeys holds shared default key-values defined in the base class. |
218 | 218 | */ |
219 | 219 | protected $aDefaultKeys = array( |
220 | - 'label_min_width' => '', // disabled as the embedded elements are all inline. |
|
221 | - 'show_debug_info' => false, // 3.8.8+ @todo Examine why this value does not override the default value of field definition arguments and if possible and appropriate, override it. |
|
220 | + 'label_min_width' => '', // disabled as the embedded elements are all inline. |
|
221 | + 'show_debug_info' => false, // 3.8.8+ @todo Examine why this value does not override the default value of field definition arguments and if possible and appropriate, override it. |
|
222 | 222 | ); |
223 | 223 | |
224 | 224 | } |
225 | 225 | \ No newline at end of file |
@@ -76,9 +76,9 @@ discard block |
||
76 | 76 | * Defines the default key-values of this field type. |
77 | 77 | */ |
78 | 78 | protected $aDefaultKeys = array( |
79 | - 'select_all_button' => false, // 3.3.0+ to change the label, set the label here |
|
80 | - 'select_none_button' => false, // 3.3.0+ to change the label, set the label here |
|
81 | - 'save_unchecked' => true, // (optional, boolean) 3.8.8+ Whether to store the values of unchecked items. |
|
79 | + 'select_all_button' => false, // 3.3.0+ to change the label, set the label here |
|
80 | + 'select_none_button' => false, // 3.3.0+ to change the label, set the label here |
|
81 | + 'save_unchecked' => true, // (optional, boolean) 3.8.8+ Whether to store the values of unchecked items. |
|
82 | 82 | ); |
83 | 83 | |
84 | 84 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | return array( |
90 | 90 | array( |
91 | 91 | 'handle_id' => 'admin-page-framework-field-type-checkbox', |
92 | - 'src' => dirname( __FILE__ ) . '/js/checkbox.bundle.js', |
|
92 | + 'src' => dirname( __FILE__ ).'/js/checkbox.bundle.js', |
|
93 | 93 | 'in_footer' => true, |
94 | 94 | 'dependencies' => array( 'jquery', 'admin-page-framework-script-form-main' ), |
95 | 95 | 'translation_var' => 'AdminPageFrameworkFieldTypeCheckbox', |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | * @return string |
110 | 110 | * @internal |
111 | 111 | */ |
112 | - private function ___getSelectButtonClassSelectors( array $aFieldTypeSlugs, $sDataAttribute='select_all_button' ) { |
|
112 | + private function ___getSelectButtonClassSelectors( array $aFieldTypeSlugs, $sDataAttribute = 'select_all_button' ) { |
|
113 | 113 | $_aClassSelectors = array(); |
114 | 114 | foreach ( $aFieldTypeSlugs as $_sSlug ) { |
115 | - if ( ! is_scalar( $_sSlug ) ) { |
|
115 | + if ( !is_scalar( $_sSlug ) ) { |
|
116 | 116 | continue; |
117 | 117 | } |
118 | - $_aClassSelectors[] = '.admin-page-framework-checkbox-container-' . $_sSlug . "[data-{$sDataAttribute}]"; |
|
118 | + $_aClassSelectors[ ] = '.admin-page-framework-checkbox-container-'.$_sSlug."[data-{$sDataAttribute}]"; |
|
119 | 119 | } |
120 | 120 | return implode( ',', $_aClassSelectors ); |
121 | 121 | } |
@@ -142,8 +142,8 @@ discard block |
||
142 | 142 | |
143 | 143 | $_aOutput = array(); |
144 | 144 | $_bIsMultiple = is_array( $aField[ 'label' ] ); |
145 | - foreach( $this->getAsArray( $aField[ 'label' ], true ) as $_sKey => $_sLabel ) { |
|
146 | - $_aOutput[] = $this->_getEachCheckboxOutput( |
|
145 | + foreach ( $this->getAsArray( $aField[ 'label' ], true ) as $_sKey => $_sLabel ) { |
|
146 | + $_aOutput[ ] = $this->_getEachCheckboxOutput( |
|
147 | 147 | $aField, |
148 | 148 | $_bIsMultiple |
149 | 149 | ? $_sKey |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | $_sLabel |
152 | 152 | ); |
153 | 153 | } |
154 | - return "<div " . $this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ) . ">" |
|
154 | + return "<div ".$this->getAttributes( $this->_getCheckboxContainerAttributes( $aField ) ).">" |
|
155 | 155 | . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element. |
156 | 156 | . implode( PHP_EOL, $_aOutput ) |
157 | 157 | . "</div>"; |
@@ -166,12 +166,12 @@ discard block |
||
166 | 166 | */ |
167 | 167 | protected function _getCheckboxContainerAttributes( array $aField ) { |
168 | 168 | return array( |
169 | - 'class' => 'admin-page-framework-checkbox-container-' . $aField[ 'type' ], |
|
169 | + 'class' => 'admin-page-framework-checkbox-container-'.$aField[ 'type' ], |
|
170 | 170 | 'data-select_all_button' => $aField[ 'select_all_button' ] |
171 | - ? ( ! is_string( $aField[ 'select_all_button' ] ) ? $this->oMsg->get( 'select_all' ) : $aField[ 'select_all_button' ] ) |
|
171 | + ? ( !is_string( $aField[ 'select_all_button' ] ) ? $this->oMsg->get( 'select_all' ) : $aField[ 'select_all_button' ] ) |
|
172 | 172 | : null, |
173 | 173 | 'data-select_none_button' => $aField[ 'select_none_button' ] |
174 | - ? ( ! is_string( $aField[ 'select_none_button' ] ) ? $this->oMsg->get( 'select_none' ) : $aField[ 'select_none_button' ] ) |
|
174 | + ? ( !is_string( $aField[ 'select_none_button' ] ) ? $this->oMsg->get( 'select_none' ) : $aField[ 'select_none_button' ] ) |
|
175 | 175 | : null, |
176 | 176 | ); |
177 | 177 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | private function _getEachCheckboxOutput( array $aField, $sKey, $sLabel ) { |
187 | 187 | |
188 | 188 | $_aInputAttributes = array( |
189 | - 'data-key' => $sKey, // 3.8.8+ For the `post_type_taxonomy` field type. |
|
189 | + 'data-key' => $sKey, // 3.8.8+ For the `post_type_taxonomy` field type. |
|
190 | 190 | ) + $aField[ 'attributes' ]; |
191 | 191 | $_oCheckbox = new AdminPageFramework_Input_checkbox( |
192 | 192 | $_aInputAttributes, |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | $_oCheckbox->setAttributesByKey( $sKey ); |
198 | 198 | $_oCheckbox->addClass( $this->_sCheckboxClassSelector ); |
199 | 199 | return $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ) |
200 | - . "<div " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-checkbox-label' ) . ">" |
|
201 | - . "<label " . $this->getAttributes( |
|
200 | + . "<div ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-container admin-page-framework-checkbox-label' ).">" |
|
201 | + . "<label ".$this->getAttributes( |
|
202 | 202 | array( |
203 | 203 | 'for' => $_oCheckbox->getAttribute( 'id' ), |
204 | 204 | 'class' => $_oCheckbox->getAttribute( 'disabled' ) |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * </code> |
73 | 73 | * @var array |
74 | 74 | */ |
75 | - public $aFieldTypeSlugs = array( 'system', ); |
|
75 | + public $aFieldTypeSlugs = array( 'system',); |
|
76 | 76 | |
77 | 77 | /** |
78 | 78 | * Defines the default key-values of this field type. |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | * @remark `$_aDefaultKeys` holds shared default key-values defined in the base class. |
93 | 93 | */ |
94 | 94 | protected $aDefaultKeys = array( |
95 | - 'data' => array(), // [3.2.0+] Stores the data to be displayed |
|
96 | - 'print_type' => 1, // [3.4.6+] 1: readable representation of array. 2: print_r() |
|
95 | + 'data' => array(), // [3.2.0+] Stores the data to be displayed |
|
96 | + 'print_type' => 1, // [3.4.6+] 1: readable representation of array. 2: print_r() |
|
97 | 97 | 'attributes' => array( |
98 | 98 | 'rows' => 60, |
99 | 99 | 'autofocus' => null, |
@@ -233,13 +233,13 @@ discard block |
||
233 | 233 | . "<div class='admin-page-framework-input-label-container'>" |
234 | 234 | . "<label for='{$aField[ 'input_id' ]}'>" |
235 | 235 | . $aField[ 'before_input' ] |
236 | - . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ] |
|
237 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
236 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
237 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
238 | 238 | . $aField[ 'label' ] |
239 | 239 | . "</span>" |
240 | 240 | : "" |
241 | 241 | ) |
242 | - . "<textarea " . $this->getAttributes( $_aInputAttributes ) . " >" |
|
242 | + . "<textarea ".$this->getAttributes( $_aInputAttributes )." >" |
|
243 | 243 | . esc_textarea( $this->___getSystemInformation( $aField[ 'value' ], $aField[ 'data' ], $aField[ 'print_type' ] ) ) |
244 | 244 | . "</textarea>" |
245 | 245 | . $aField[ 'after_input' ] |
@@ -257,15 +257,15 @@ discard block |
||
257 | 257 | * @param integer $iPrintType |
258 | 258 | * @internal |
259 | 259 | */ |
260 | - private function ___getSystemInformation( $asValue=null, $asCustomData=null, $iPrintType=1 ) { |
|
260 | + private function ___getSystemInformation( $asValue = null, $asCustomData = null, $iPrintType = 1 ) { |
|
261 | 261 | |
262 | 262 | if ( isset( $asValue ) ) { |
263 | 263 | return $asValue; |
264 | 264 | } |
265 | 265 | |
266 | - $_aOutput = array(); |
|
267 | - foreach( $this->___getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) { |
|
268 | - $_aOutput[] = $this->_____getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType ); |
|
266 | + $_aOutput = array(); |
|
267 | + foreach ( $this->___getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) { |
|
268 | + $_aOutput[ ] = $this->_____getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType ); |
|
269 | 269 | } |
270 | 270 | return implode( PHP_EOL, $_aOutput ); |
271 | 271 | |
@@ -281,15 +281,15 @@ discard block |
||
281 | 281 | |
282 | 282 | $_aData = $this->getAsArray( $asCustomData ); |
283 | 283 | $_aData = $_aData + array( |
284 | - 'WordPress' => $this->___getSiteInfoWithCache( ! isset( $_aData[ 'WordPress' ] ) ), |
|
285 | - 'PHP' => $this->_getPHPInfo( ! isset( $_aData[ 'PHP' ] ) ), |
|
286 | - 'PHP Error Log' => $this->___getErrorLogByType( 'php', ! isset( $_aData[ 'PHP Error Log' ] ) ), |
|
284 | + 'WordPress' => $this->___getSiteInfoWithCache( !isset( $_aData[ 'WordPress' ] ) ), |
|
285 | + 'PHP' => $this->_getPHPInfo( !isset( $_aData[ 'PHP' ] ) ), |
|
286 | + 'PHP Error Log' => $this->___getErrorLogByType( 'php', !isset( $_aData[ 'PHP Error Log' ] ) ), |
|
287 | 287 | 'MySQL' => isset( $_aData[ 'MySQL' ] ) |
288 | 288 | ? null |
289 | - : $this->getMySQLInfo(), // defined in the utility class. |
|
290 | - 'MySQL Error Log' => $this->___getErrorLogByType( 'mysql', ! isset( $_aData[ 'MySQL Error Log' ] ) ), |
|
291 | - 'Server' => $this->___getWebServerInfo( ! isset( $_aData[ 'Server' ] ) ), |
|
292 | - 'Browser' => $this->___getClientInfo( ! isset( $_aData[ 'Browser' ] ) ), |
|
289 | + : $this->getMySQLInfo(), // defined in the utility class. |
|
290 | + 'MySQL Error Log' => $this->___getErrorLogByType( 'mysql', !isset( $_aData[ 'MySQL Error Log' ] ) ), |
|
291 | + 'Server' => $this->___getWebServerInfo( !isset( $_aData[ 'Server' ] ) ), |
|
292 | + 'Browser' => $this->___getClientInfo( !isset( $_aData[ 'Browser' ] ) ), |
|
293 | 293 | 'Admin Page Framework' => isset( $_aData[ 'Admin Page Framework' ] ) |
294 | 294 | ? null |
295 | 295 | : AdminPageFramework_Registry::getInfo(), |
@@ -312,10 +312,10 @@ discard block |
||
312 | 312 | switch ( $iPrintType ) { |
313 | 313 | default: |
314 | 314 | case 1: // use the framework readable representation of arrays. |
315 | - return $this->getReadableArrayContents( $sSectionName, $aData, 32 ) . PHP_EOL; |
|
315 | + return $this->getReadableArrayContents( $sSectionName, $aData, 32 ).PHP_EOL; |
|
316 | 316 | case 2: // use print_r() |
317 | - return "[{$sSectionName}]" . PHP_EOL |
|
318 | - . print_r( $aData, true ) . PHP_EOL; |
|
317 | + return "[{$sSectionName}]".PHP_EOL |
|
318 | + . print_r( $aData, true ).PHP_EOL; |
|
319 | 319 | } |
320 | 320 | } |
321 | 321 | /** |
@@ -327,9 +327,9 @@ discard block |
||
327 | 327 | * @param boolean $bGenerateInfo |
328 | 328 | * @return string |
329 | 329 | */ |
330 | - private function ___getClientInfo( $bGenerateInfo=true ) { |
|
330 | + private function ___getClientInfo( $bGenerateInfo = true ) { |
|
331 | 331 | |
332 | - if ( ! $bGenerateInfo ) { |
|
332 | + if ( !$bGenerateInfo ) { |
|
333 | 333 | return ''; |
334 | 334 | } |
335 | 335 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $_aBrowser = @ini_get( 'browscap' ) |
338 | 338 | ? get_browser( $_SERVER[ 'HTTP_USER_AGENT' ], true ) |
339 | 339 | : array(); |
340 | - unset( $_aBrowser[ 'browser_name_regex' ] ); // this element causes output to be blank |
|
340 | + unset( $_aBrowser[ 'browser_name_regex' ] ); // this element causes output to be blank |
|
341 | 341 | return empty( $_aBrowser ) |
342 | 342 | ? __( 'No browser information found.', 'admin-page-framework' ) |
343 | 343 | : $_aBrowser; |
@@ -353,9 +353,9 @@ discard block |
||
353 | 353 | * @param string $sType The error log type. Either 'php' or 'mysql' is accepted. |
354 | 354 | * @param boolean $bGenerateInfo Whether to generate a log. This is for the caller method to reduce a conditinal statement. |
355 | 355 | */ |
356 | - private function ___getErrorLogByType( $sType, $bGenerateInfo=true ) { |
|
356 | + private function ___getErrorLogByType( $sType, $bGenerateInfo = true ) { |
|
357 | 357 | |
358 | - if ( ! $bGenerateInfo ) { |
|
358 | + if ( !$bGenerateInfo ) { |
|
359 | 359 | return ''; |
360 | 360 | } |
361 | 361 | switch ( $sType ) { |
@@ -388,9 +388,9 @@ discard block |
||
388 | 388 | * @param boolean $bGenerateInfo |
389 | 389 | * @return array The generated site information array. |
390 | 390 | */ |
391 | - private function ___getSiteInfoWithCache( $bGenerateInfo=true ) { |
|
391 | + private function ___getSiteInfoWithCache( $bGenerateInfo = true ) { |
|
392 | 392 | |
393 | - if ( ! $bGenerateInfo || isset( self::$_aSiteInfo ) ) { |
|
393 | + if ( !$bGenerateInfo || isset( self::$_aSiteInfo ) ) { |
|
394 | 394 | return self::$_aSiteInfo; |
395 | 395 | } |
396 | 396 | self::$_aSiteInfo = self::___getSiteInfo(); |
@@ -424,8 +424,8 @@ discard block |
||
424 | 424 | 'wp_remote_get()' => $this->___getWPRemoteGetStatus(), |
425 | 425 | __( 'Multibite String Extension', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'mb_detect_encoding' ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ), |
426 | 426 | __( 'WP_CONTENT_DIR Writeable', 'admin-page-framework' ) => $this->getAOrB( is_writable( WP_CONTENT_DIR ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
427 | - __( 'Active Plugins', 'admin-page-framework' ) => PHP_EOL . $this->___getActivePlugins(), |
|
428 | - __( 'Network Active Plugins', 'admin-page-framework' ) => PHP_EOL . $this->___getNetworkActivePlugins(), |
|
427 | + __( 'Active Plugins', 'admin-page-framework' ) => PHP_EOL.$this->___getActivePlugins(), |
|
428 | + __( 'Network Active Plugins', 'admin-page-framework' ) => PHP_EOL.$this->___getNetworkActivePlugins(), |
|
429 | 429 | __( 'Constants', 'admin-page-framework' ) => $this->___getDefinedConstants( 'user' ), |
430 | 430 | ); |
431 | 431 | } |
@@ -437,9 +437,9 @@ discard block |
||
437 | 437 | * @return string|array |
438 | 438 | * @internal |
439 | 439 | */ |
440 | - private function ___getDefinedConstants( $asCategories=null, $asRemovingCategories=null ) { |
|
440 | + private function ___getDefinedConstants( $asCategories = null, $asRemovingCategories = null ) { |
|
441 | 441 | $_asConstants = $this->getDefinedConstants( $asCategories, $asRemovingCategories ); |
442 | - if ( ! is_array( $_asConstants ) ) { |
|
442 | + if ( !is_array( $_asConstants ) ) { |
|
443 | 443 | return $_asConstants; |
444 | 444 | } |
445 | 445 | if ( isset( $_asConstants[ 'user' ] ) ) { |
@@ -476,12 +476,12 @@ discard block |
||
476 | 476 | |
477 | 477 | // If the WordPress version is less than 3.4, |
478 | 478 | if ( version_compare( $GLOBALS[ 'wp_version' ], '3.4', '<' ) ) { |
479 | - $_aThemeData = get_theme_data( get_stylesheet_directory() . '/style.css' ); |
|
480 | - return $_aThemeData[ 'Name' ] . ' ' . $_aThemeData[ 'Version' ]; |
|
479 | + $_aThemeData = get_theme_data( get_stylesheet_directory().'/style.css' ); |
|
480 | + return $_aThemeData[ 'Name' ].' '.$_aThemeData[ 'Version' ]; |
|
481 | 481 | } |
482 | 482 | |
483 | 483 | $_oThemeData = wp_get_theme(); |
484 | - return $_oThemeData->Name . ' ' . $_oThemeData->Version; |
|
484 | + return $_oThemeData->Name.' '.$_oThemeData->Version; |
|
485 | 485 | |
486 | 486 | } |
487 | 487 | /** |
@@ -495,10 +495,10 @@ discard block |
||
495 | 495 | $_aPluginList = array(); |
496 | 496 | $_aActivePlugins = get_option( 'active_plugins', array() ); |
497 | 497 | foreach ( get_plugins() as $_sPluginPath => $_aPlugin ) { |
498 | - if ( ! in_array( $_sPluginPath, $_aActivePlugins ) ) { |
|
498 | + if ( !in_array( $_sPluginPath, $_aActivePlugins ) ) { |
|
499 | 499 | continue; |
500 | 500 | } |
501 | - $_aPluginList[] = ' ' . $_aPlugin[ 'Name' ] . ': ' . $_aPlugin[ 'Version' ]; |
|
501 | + $_aPluginList[ ] = ' '.$_aPlugin[ 'Name' ].': '.$_aPlugin[ 'Version' ]; |
|
502 | 502 | } |
503 | 503 | return implode( PHP_EOL, $_aPluginList ); |
504 | 504 | |
@@ -510,17 +510,17 @@ discard block |
||
510 | 510 | */ |
511 | 511 | private function ___getNetworkActivePlugins() { |
512 | 512 | |
513 | - if ( ! is_multisite() ) { |
|
513 | + if ( !is_multisite() ) { |
|
514 | 514 | return ''; |
515 | 515 | } |
516 | 516 | $_aPluginList = array(); |
517 | 517 | $_aActivePlugins = get_site_option( 'active_sitewide_plugins', array() ); |
518 | 518 | foreach ( wp_get_active_network_plugins() as $_sPluginPath ) { |
519 | - if ( ! array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) { |
|
519 | + if ( !array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) { |
|
520 | 520 | continue; |
521 | 521 | } |
522 | 522 | $_aPlugin = get_plugin_data( $_sPluginPath ); |
523 | - $_aPluginList[] = ' ' . $_aPlugin[ 'Name' ] . ' :' . $_aPlugin[ 'Version' ]; |
|
523 | + $_aPluginList[ ] = ' '.$_aPlugin[ 'Name' ].' :'.$_aPlugin[ 'Version' ]; |
|
524 | 524 | } |
525 | 525 | return implode( PHP_EOL, $_aPluginList ); |
526 | 526 | |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | if ( is_wp_error( $aoResponse ) ) { |
585 | 585 | return true; |
586 | 586 | } |
587 | - if ( $aoResponse[ 'response'][ 'code' ] < 200 ) { |
|
587 | + if ( $aoResponse[ 'response' ][ 'code' ] < 200 ) { |
|
588 | 588 | return true; |
589 | 589 | } |
590 | 590 | if ( $aoResponse[ 'response' ][ 'code' ] >= 300 ) { |
@@ -610,13 +610,13 @@ discard block |
||
610 | 610 | * @param boolean $bGenerateInfo |
611 | 611 | * @return array |
612 | 612 | */ |
613 | - private function _getPHPInfo( $bGenerateInfo=true ) { |
|
613 | + private function _getPHPInfo( $bGenerateInfo = true ) { |
|
614 | 614 | |
615 | - if ( ! $bGenerateInfo || isset( self::$_aPHPInfo ) ) { |
|
615 | + if ( !$bGenerateInfo || isset( self::$_aPHPInfo ) ) { |
|
616 | 616 | return self::$_aPHPInfo; |
617 | 617 | } |
618 | 618 | |
619 | - $_oErrorReporting = new AdminPageFramework_ErrorReporting; |
|
619 | + $_oErrorReporting = new AdminPageFramework_ErrorReporting; |
|
620 | 620 | self::$_aPHPInfo = array( |
621 | 621 | __( 'Version', 'admin-page-framework' ) => phpversion(), |
622 | 622 | __( 'Safe Mode', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'safe_mode' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
@@ -627,16 +627,16 @@ discard block |
||
627 | 627 | __( 'Max Execution Time', 'admin-page-framework' ) => @ini_get( 'max_execution_time' ), |
628 | 628 | __( 'Max Input Vars', 'admin-page-framework' ) => @ini_get( 'max_input_vars' ), |
629 | 629 | __( 'Argument Separator', 'admin-page-framework' ) => @ini_get( 'arg_separator.output' ), |
630 | - __( 'Allow URL File Open', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'allow_url_fopen' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
|
631 | - __( 'Display Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'display_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
632 | - __( 'Log Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'log_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
630 | + __( 'Allow URL File Open', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'allow_url_fopen' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
|
631 | + __( 'Display Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'display_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
632 | + __( 'Log Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'log_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
633 | 633 | __( 'Error log location', 'admin-page-framework' ) => @ini_get( 'error_log' ), |
634 | 634 | __( 'Error Reporting Level', 'admin-page-framework' ) => $_oErrorReporting->getErrorLevel(), |
635 | - __( 'FSOCKOPEN', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'fsockopen' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
636 | - __( 'cURL', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'curl_init' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
637 | - __( 'SOAP', 'admin-page-framework' ) => $this->getAOrB( class_exists( 'SoapClient' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
638 | - __( 'SUHOSIN', 'admin-page-framework' ) => $this->getAOrB( extension_loaded( 'suhosin' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
639 | - 'ini_set()' => $this->getAOrB( function_exists( 'ini_set' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
635 | + __( 'FSOCKOPEN', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'fsockopen' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
636 | + __( 'cURL', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'curl_init' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
637 | + __( 'SOAP', 'admin-page-framework' ) => $this->getAOrB( class_exists( 'SoapClient' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
638 | + __( 'SUHOSIN', 'admin-page-framework' ) => $this->getAOrB( extension_loaded( 'suhosin' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
639 | + 'ini_set()' => $this->getAOrB( function_exists( 'ini_set' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
640 | 640 | ) |
641 | 641 | + $this->getPHPInfo() |
642 | 642 | + array( |
@@ -656,10 +656,10 @@ discard block |
||
656 | 656 | * @param boolean $bGenerateInfo |
657 | 657 | * @return array|string |
658 | 658 | */ |
659 | - private function ___getWebServerInfo( $bGenerateInfo=true ) { |
|
659 | + private function ___getWebServerInfo( $bGenerateInfo = true ) { |
|
660 | 660 | return $bGenerateInfo |
661 | 661 | ? array( |
662 | - __( 'Web Server', 'admin-page-framework' ) => $_SERVER['SERVER_SOFTWARE'], |
|
662 | + __( 'Web Server', 'admin-page-framework' ) => $_SERVER[ 'SERVER_SOFTWARE' ], |
|
663 | 663 | 'SSL' => $this->getAOrB( is_ssl(), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
664 | 664 | __( 'Session', 'admin-page-framework' ) => $this->getAOrB( isset( $_SESSION ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ), |
665 | 665 | __( 'Session Name', 'admin-page-framework' ) => esc_html( @ini_get( 'session.name' ) ), |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | /** |
81 | 81 | * Defines the field type slugs used for this field type. |
82 | 82 | */ |
83 | - public $aFieldTypeSlugs = array( 'posttype', ); |
|
83 | + public $aFieldTypeSlugs = array( 'posttype',); |
|
84 | 84 | |
85 | 85 | /** |
86 | 86 | * Defines the default key-values of this field type. |
@@ -88,20 +88,20 @@ discard block |
||
88 | 88 | * @remark $_aDefaultKeys holds shared default key-values defined in the base class. |
89 | 89 | */ |
90 | 90 | protected $aDefaultKeys = array( |
91 | - 'slugs_to_remove' => null, // the default array will be assigned in the rendering method. |
|
91 | + 'slugs_to_remove' => null, // the default array will be assigned in the rendering method. |
|
92 | 92 | /** |
93 | 93 | * Accepts query arguments. For the argument specification, see the arg parameter of get_post_types() function. |
94 | 94 | * See: http://codex.wordpress.org/Function_Reference/get_post_types#Parameters |
95 | 95 | */ |
96 | - 'query' => array(), // 3.2.1+ |
|
97 | - 'operator' => 'and', // 3.2.1+ either 'and' or 'or' |
|
96 | + 'query' => array(), // 3.2.1+ |
|
97 | + 'operator' => 'and', // 3.2.1+ either 'and' or 'or' |
|
98 | 98 | 'attributes' => array( |
99 | 99 | 'size' => 30, |
100 | 100 | 'maxlength' => 400, |
101 | 101 | ), |
102 | - 'select_all_button' => true, // 3.3.0+ to change the label, set the label here |
|
103 | - 'select_none_button' => true, // 3.3.0+ to change the label, set the label here |
|
104 | - 'save_unchecked' => true, // (optional, boolean) 3.8.8+ Whether to store the values of unchecked items. |
|
102 | + 'select_all_button' => true, // 3.3.0+ to change the label, set the label here |
|
103 | + 'select_none_button' => true, // 3.3.0+ to change the label, set the label here |
|
104 | + 'save_unchecked' => true, // (optional, boolean) 3.8.8+ Whether to store the values of unchecked items. |
|
105 | 105 | ); |
106 | 106 | protected $aDefaultRemovingPostTypeSlugs = array( |
107 | 107 | 'revision', |
@@ -123,11 +123,11 @@ discard block |
||
123 | 123 | * @return string |
124 | 124 | */ |
125 | 125 | protected function getField( $aField ) { |
126 | - $this->_sCheckboxClassSelector = ''; // disable the checkbox class selector. |
|
126 | + $this->_sCheckboxClassSelector = ''; // disable the checkbox class selector. |
|
127 | 127 | $aField[ 'label' ] = $this->_getPostTypeArrayForChecklist( |
128 | 128 | isset( $aField[ 'slugs_to_remove' ] ) |
129 | 129 | ? $this->getAsArray( $aField[ 'slugs_to_remove' ] ) |
130 | - : $this->aDefaultRemovingPostTypeSlugs, // slugs to remove |
|
130 | + : $this->aDefaultRemovingPostTypeSlugs, // slugs to remove |
|
131 | 131 | $aField[ 'query' ], |
132 | 132 | $aField[ 'operator' ] |
133 | 133 | ); |
@@ -147,10 +147,10 @@ discard block |
||
147 | 147 | * @return array The array holding the elements of installed post types' labels and their slugs except the specified expluding post types. |
148 | 148 | * @internal |
149 | 149 | */ |
150 | - private function _getPostTypeArrayForChecklist( $aSlugsToRemove, $asQueryArgs=array(), $sOperator='and' ) { |
|
150 | + private function _getPostTypeArrayForChecklist( $aSlugsToRemove, $asQueryArgs = array(), $sOperator = 'and' ) { |
|
151 | 151 | $_aPostTypes = array(); |
152 | - foreach( get_post_types( $asQueryArgs, 'objects' ) as $_oPostType ) { |
|
153 | - if ( isset( $_oPostType->name, $_oPostType->label ) ) { |
|
152 | + foreach ( get_post_types( $asQueryArgs, 'objects' ) as $_oPostType ) { |
|
153 | + if ( isset( $_oPostType->name, $_oPostType->label ) ) { |
|
154 | 154 | $_aPostTypes[ $_oPostType->name ] = $_oPostType->label; |
155 | 155 | } |
156 | 156 | } |