@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | protected function setUp() { |
64 | 64 | |
65 | 65 | // If the WordPress version is greater than or equal to 3.5, then load the new WordPress color picker. |
66 | - if ( version_compare( $GLOBALS['wp_version'], '3.5', '>=' ) ) { |
|
66 | + if ( version_compare( $GLOBALS[ 'wp_version' ], '3.5', '>=' ) ) { |
|
67 | 67 | //Both the necessary css and javascript have been registered already by WordPress, so all we have to do is load them with their handle. |
68 | 68 | wp_enqueue_style( 'wp-color-picker' ); |
69 | 69 | wp_enqueue_script( 'wp-color-picker' ); |
@@ -235,9 +235,9 @@ discard block |
||
235 | 235 | protected function getField( $aField ) { |
236 | 236 | |
237 | 237 | // If the value is not set, apply the default value, 'transparent'. |
238 | - $aField['value'] = is_null( $aField['value'] ) |
|
238 | + $aField[ 'value' ] = is_null( $aField[ 'value' ] ) |
|
239 | 239 | ? 'transparent' |
240 | - : $aField['value']; |
|
240 | + : $aField[ 'value' ]; |
|
241 | 241 | |
242 | 242 | $aField[ 'attributes' ] = $this->_getInputAttributes( $aField ); |
243 | 243 | |
@@ -246,20 +246,20 @@ discard block |
||
246 | 246 | . "<div class='admin-page-framework-input-label-container'>" |
247 | 247 | . "<label for='{$aField[ 'input_id' ]}'>" |
248 | 248 | . $aField[ 'before_input' ] |
249 | - . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ] |
|
250 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
251 | - . $aField['label'] |
|
249 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
250 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
251 | + . $aField[ 'label' ] |
|
252 | 252 | . "</span>" |
253 | 253 | : "" |
254 | 254 | ) |
255 | - . "<input " . $this->getAttributes( $aField[ 'attributes' ] ) . " />" |
|
255 | + . "<input ".$this->getAttributes( $aField[ 'attributes' ] )." />" |
|
256 | 256 | . $aField[ 'after_input' ] |
257 | 257 | . "<div class='repeatable-field-buttons'></div>" // the repeatable field buttons will be replaced with this element. |
258 | 258 | . "</label>" |
259 | 259 | . "<div class='colorpicker' id='color_{$aField[ 'input_id' ]}'></div>" // this div element with this class selector becomes a farbtastic color picker. ( below 3.4.x ) // rel='{$aField['input_id']}' |
260 | 260 | . $this->_getColorPickerEnablerScript( "{$aField[ 'input_id' ]}" ) |
261 | 261 | . "</div>" |
262 | - . $aField['after_label']; |
|
262 | + . $aField[ 'after_label' ]; |
|
263 | 263 | |
264 | 264 | } |
265 | 265 | /** |
@@ -271,13 +271,13 @@ discard block |
||
271 | 271 | private function _getInputAttributes( array $aField ) { |
272 | 272 | |
273 | 273 | return array( |
274 | - 'color' => $aField['value'], |
|
275 | - 'value' => $aField['value'], |
|
274 | + 'color' => $aField[ 'value' ], |
|
275 | + 'value' => $aField[ 'value' ], |
|
276 | 276 | 'data-default' => isset( $aField[ 'default' ] ) |
277 | 277 | ? $aField[ 'default' ] |
278 | 278 | : 'transparent', // used by the repeatable script |
279 | 279 | 'type' => 'text', // it must be text |
280 | - 'class' => trim( 'input_color ' . $aField['attributes']['class'] ), |
|
280 | + 'class' => trim( 'input_color '.$aField[ 'attributes' ][ 'class' ] ), |
|
281 | 281 | ) + $aField[ 'attributes' ]; |
282 | 282 | |
283 | 283 | } |
@@ -554,8 +554,8 @@ discard block |
||
554 | 554 | protected function getField( $aField ) { |
555 | 555 | |
556 | 556 | $_aOutput = array(); |
557 | - foreach( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
558 | - $_aOutput[] = $this->_getFieldOutputByLabel( |
|
557 | + foreach ( ( array ) $aField[ 'label' ] as $_sKey => $_sLabel ) { |
|
558 | + $_aOutput[ ] = $this->_getFieldOutputByLabel( |
|
559 | 559 | $_sKey, |
560 | 560 | $_sLabel, |
561 | 561 | $aField |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | } |
564 | 564 | |
565 | 565 | // the repeatable field buttons will be replaced with this element. |
566 | - $_aOutput[] = "<div class='repeatable-field-buttons'></div>"; |
|
566 | + $_aOutput[ ] = "<div class='repeatable-field-buttons'></div>"; |
|
567 | 567 | return implode( '', $_aOutput ); |
568 | 568 | |
569 | 569 | } |
@@ -584,27 +584,27 @@ discard block |
||
584 | 584 | $aField[ 'rich' ] = $this->getElementByLabel( $aField[ 'rich' ], $sKey, $aField[ 'label' ] ); |
585 | 585 | $aField[ 'attributes' ] = $_bIsArray |
586 | 586 | ? array( |
587 | - 'name' => $aField[ 'attributes' ][ 'name' ] . "[{$sKey}]", |
|
588 | - 'id' => $aField[ 'attributes' ][ 'id' ] . "_{$sKey}", |
|
587 | + 'name' => $aField[ 'attributes' ][ 'name' ]."[{$sKey}]", |
|
588 | + 'id' => $aField[ 'attributes' ][ 'id' ]."_{$sKey}", |
|
589 | 589 | 'value' => $aField[ 'value' ], |
590 | 590 | ) |
591 | 591 | + $aField[ 'attributes' ] |
592 | 592 | : $aField[ 'attributes' ]; |
593 | - $_aOutput = array( |
|
594 | - $this->getElementByLabel( $aField['before_label'], $sKey, $aField[ 'label' ] ), |
|
593 | + $_aOutput = array( |
|
594 | + $this->getElementByLabel( $aField[ 'before_label' ], $sKey, $aField[ 'label' ] ), |
|
595 | 595 | "<div class='admin-page-framework-input-label-container {$_sClassSelector}'>", |
596 | - "<label for='" . $aField[ 'attributes' ][ 'id' ] . "'>", |
|
597 | - $this->getElementByLabel( $aField['before_input'], $sKey, $aField[ 'label' ] ), |
|
596 | + "<label for='".$aField[ 'attributes' ][ 'id' ]."'>", |
|
597 | + $this->getElementByLabel( $aField[ 'before_input' ], $sKey, $aField[ 'label' ] ), |
|
598 | 598 | $_sLabel |
599 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
599 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
600 | 600 | . $_sLabel |
601 | 601 | . "</span>" |
602 | 602 | : '', |
603 | 603 | $this->_getEditor( $aField ), |
604 | - $this->getElementByLabel( $aField['after_input'], $sKey, $aField[ 'label' ] ), |
|
604 | + $this->getElementByLabel( $aField[ 'after_input' ], $sKey, $aField[ 'label' ] ), |
|
605 | 605 | "</label>", |
606 | 606 | "</div>", |
607 | - $this->getElementByLabel( $aField['after_label'], $sKey, $aField[ 'label' ] ), |
|
607 | + $this->getElementByLabel( $aField[ 'after_label' ], $sKey, $aField[ 'label' ] ), |
|
608 | 608 | ); |
609 | 609 | return implode( '', $_aOutput ); |
610 | 610 | |
@@ -619,31 +619,31 @@ discard block |
||
619 | 619 | */ |
620 | 620 | private function _getEditor( $aField ) { |
621 | 621 | |
622 | - unset( $aField['attributes']['value'] ); |
|
622 | + unset( $aField[ 'attributes' ][ 'value' ] ); |
|
623 | 623 | |
624 | 624 | // For no TinyMCE |
625 | - if ( empty( $aField['rich'] ) || ! $this->isTinyMCESupported() ) { |
|
626 | - return "<textarea " . $this->getAttributes( $aField['attributes'] ) . " >" // this method is defined in the base class |
|
627 | - . esc_textarea( $aField['value'] ) |
|
625 | + if ( empty( $aField[ 'rich' ] ) || !$this->isTinyMCESupported() ) { |
|
626 | + return "<textarea ".$this->getAttributes( $aField[ 'attributes' ] )." >" // this method is defined in the base class |
|
627 | + . esc_textarea( $aField[ 'value' ] ) |
|
628 | 628 | . "</textarea>"; |
629 | 629 | } |
630 | 630 | |
631 | 631 | // Rich editor |
632 | 632 | ob_start(); |
633 | 633 | wp_editor( |
634 | - $aField['value'], |
|
635 | - $aField['attributes']['id'], |
|
634 | + $aField[ 'value' ], |
|
635 | + $aField[ 'attributes' ][ 'id' ], |
|
636 | 636 | $this->uniteArrays( |
637 | - ( array ) $aField['rich'], |
|
637 | + ( array ) $aField[ 'rich' ], |
|
638 | 638 | array( |
639 | 639 | 'wpautop' => true, // use wpautop? |
640 | 640 | 'media_buttons' => true, // show insert/upload button(s) |
641 | - 'textarea_name' => $aField['attributes']['name'], |
|
642 | - 'textarea_rows' => $aField['attributes']['rows'], |
|
641 | + 'textarea_name' => $aField[ 'attributes' ][ 'name' ], |
|
642 | + 'textarea_rows' => $aField[ 'attributes' ][ 'rows' ], |
|
643 | 643 | 'tabindex' => '', |
644 | 644 | 'tabfocus_elements' => ':prev,:next', // the previous and next element ID to move the focus to when pressing the Tab key in TinyMCE |
645 | 645 | 'editor_css' => '', // intended for extra styles for both visual and Text editors buttons, needs to include the <style> tags, can use "scoped". |
646 | - 'editor_class' => $aField['attributes']['class'], // add extra class(es) to the editor textarea |
|
646 | + 'editor_class' => $aField[ 'attributes' ][ 'class' ], // add extra class(es) to the editor textarea |
|
647 | 647 | 'teeny' => false, // output the minimal editor config used in Press This |
648 | 648 | 'dfw' => false, // replace the default fullscreen with DFW (needs specific DOM elements and css) |
649 | 649 | 'tinymce' => true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array() |
@@ -655,7 +655,7 @@ discard block |
||
655 | 655 | ob_end_clean(); |
656 | 656 | |
657 | 657 | return $_sContent |
658 | - . $this->_getScriptForRichEditor( $aField['attributes']['id'] ); |
|
658 | + . $this->_getScriptForRichEditor( $aField[ 'attributes' ][ 'id' ] ); |
|
659 | 659 | |
660 | 660 | } |
661 | 661 |
@@ -37,21 +37,21 @@ |
||
37 | 37 | */ |
38 | 38 | public function _replyToGetField( $aField ) { |
39 | 39 | return |
40 | - $aField['before_label'] |
|
40 | + $aField[ 'before_label' ] |
|
41 | 41 | . "<div class='admin-page-framework-input-label-container'>" |
42 | - . "<label for='{$aField['input_id']}'>" |
|
43 | - . $aField['before_input'] |
|
44 | - . ( $aField['label'] && ! $aField['repeatable'] |
|
45 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
42 | + . "<label for='{$aField[ 'input_id' ]}'>" |
|
43 | + . $aField[ 'before_input' ] |
|
44 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
45 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
46 | 46 | . $aField[ 'label' ] |
47 | 47 | . "</span>" |
48 | 48 | : "" |
49 | 49 | ) |
50 | - . $aField['value'] |
|
51 | - . $aField['after_input'] |
|
50 | + . $aField[ 'value' ] |
|
51 | + . $aField[ 'after_input' ] |
|
52 | 52 | . "</label>" |
53 | 53 | . "</div>" |
54 | - . $aField['after_label'] |
|
54 | + . $aField[ 'after_label' ] |
|
55 | 55 | ; |
56 | 56 | } |
57 | 57 |
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function _appendInternalAssets( $sInternal, &$aContainer ) { |
70 | 70 | $_aInternals = array_unique( $aContainer ); |
71 | - $sInternal = PHP_EOL . $sInternal; |
|
72 | - foreach( $_aInternals as $_iIndex => $_sInternal ) { |
|
73 | - $sInternal .= $_sInternal . PHP_EOL; |
|
71 | + $sInternal = PHP_EOL.$sInternal; |
|
72 | + foreach ( $_aInternals as $_iIndex => $_sInternal ) { |
|
73 | + $sInternal .= $_sInternal.PHP_EOL; |
|
74 | 74 | unset( $_aInternals[ $_iIndex ] ); |
75 | 75 | } |
76 | 76 | $aContainer = $_aInternals; // update the container array. |
@@ -84,23 +84,23 @@ discard block |
||
84 | 84 | private function _parseAssets( $oFactory ) { |
85 | 85 | |
86 | 86 | // page |
87 | - $_aPageStyles = $this->getElementAsArray( |
|
87 | + $_aPageStyles = $this->getElementAsArray( |
|
88 | 88 | $oFactory->oProp->aPages, |
89 | 89 | array( $this->sCurrentPageSlug, 'style' ) |
90 | 90 | ); |
91 | 91 | $this->_enqueuePageAssets( $_aPageStyles, 'style' ); |
92 | 92 | |
93 | - $_aPageScripts = $this->getElementAsArray( |
|
93 | + $_aPageScripts = $this->getElementAsArray( |
|
94 | 94 | $oFactory->oProp->aPages, |
95 | 95 | array( $this->sCurrentPageSlug, 'script' ) |
96 | 96 | ); |
97 | 97 | $this->_enqueuePageAssets( $_aPageScripts, 'script' ); |
98 | 98 | |
99 | 99 | // In-page tabs |
100 | - if ( ! $this->sCurrentTabSlug ) { |
|
100 | + if ( !$this->sCurrentTabSlug ) { |
|
101 | 101 | return; |
102 | 102 | } |
103 | - $_aInPageTabStyles = $this->getElementAsArray( |
|
103 | + $_aInPageTabStyles = $this->getElementAsArray( |
|
104 | 104 | $oFactory->oProp->aInPageTabs, |
105 | 105 | array( $this->sCurrentPageSlug, $this->sCurrentTabSlug, 'style' ) |
106 | 106 | ); |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | * @since 3.6.3 |
118 | 118 | * @return void |
119 | 119 | */ |
120 | - private function _enqueuePageAssets( array $aPageAssets, $sType='style' ) { |
|
121 | - $_sMathodName = "_enqueueAsset_" . $sType; |
|
122 | - foreach( $aPageAssets as $_asPageAsset ) { |
|
123 | - $this->{$_sMathodName}( $_asPageAsset); |
|
120 | + private function _enqueuePageAssets( array $aPageAssets, $sType = 'style' ) { |
|
121 | + $_sMathodName = "_enqueueAsset_".$sType; |
|
122 | + foreach ( $aPageAssets as $_asPageAsset ) { |
|
123 | + $this->{$_sMathodName}( $_asPageAsset ); |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | // Insert the CSS rule in the head tag. |
148 | - $this->aCSSRules[] = $_sSRC; |
|
148 | + $this->aCSSRules[ ] = $_sSRC; |
|
149 | 149 | |
150 | 150 | } |
151 | 151 | |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | } |
171 | 171 | |
172 | 172 | // Insert the scripts in the head tag. |
173 | - $this->aScripts[] = $_sSRC; |
|
173 | + $this->aScripts[ ] = $_sSRC; |
|
174 | 174 | |
175 | 175 | } |
176 | 176 |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | static public function getRelativePath( $from, $to ) { |
30 | 30 | |
31 | 31 | // some compatibility fixes for Windows paths |
32 | - $from = is_dir( $from ) ? rtrim( $from, '\/') . '/' : $from; |
|
33 | - $to = is_dir( $to ) ? rtrim( $to, '\/') . '/' : $to; |
|
32 | + $from = is_dir( $from ) ? rtrim( $from, '\/' ).'/' : $from; |
|
33 | + $to = is_dir( $to ) ? rtrim( $to, '\/' ).'/' : $to; |
|
34 | 34 | $from = str_replace( '\\', '/', $from ); |
35 | 35 | $to = str_replace( '\\', '/', $to ); |
36 | 36 | |
@@ -38,21 +38,21 @@ discard block |
||
38 | 38 | $to = explode( '/', $to ); |
39 | 39 | $relPath = $to; |
40 | 40 | |
41 | - foreach( $from as $depth => $dir ) { |
|
41 | + foreach ( $from as $depth => $dir ) { |
|
42 | 42 | // find first non-matching dir |
43 | - if( $dir === $to[ $depth ] ) { |
|
43 | + if ( $dir === $to[ $depth ] ) { |
|
44 | 44 | // ignore this directory |
45 | 45 | array_shift( $relPath ); |
46 | 46 | } else { |
47 | 47 | // get number of remaining dirs to $from |
48 | 48 | $remaining = count( $from ) - $depth; |
49 | - if( $remaining > 1 ) { |
|
49 | + if ( $remaining > 1 ) { |
|
50 | 50 | // add traversals up to first matching dir |
51 | 51 | $padLength = ( count( $relPath ) + $remaining - 1 ) * -1; |
52 | 52 | $relPath = array_pad( $relPath, $padLength, '..' ); |
53 | 53 | break; |
54 | 54 | } else { |
55 | - $relPath[ 0 ] = './' . $relPath[ 0 ]; |
|
55 | + $relPath[ 0 ] = './'.$relPath[ 0 ]; |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | 6, // the second parameter: limit |
82 | 82 | ) |
83 | 83 | ); |
84 | - foreach( $_aBackTrace as $_aDebugInfo ) { |
|
84 | + foreach ( $_aBackTrace as $_aDebugInfo ) { |
|
85 | 85 | $_sCallerFilePath = $_aDebugInfo[ 'file' ]; |
86 | 86 | if ( in_array( $_sCallerFilePath, $_aRedirectedFilePaths ) ) { |
87 | 87 | continue; |
@@ -81,9 +81,9 @@ |
||
81 | 81 | 6, // the second parameter: limit |
82 | 82 | ) |
83 | 83 | ); |
84 | - foreach( $_aBackTrace as $_aDebugInfo ) { |
|
84 | + foreach( $_aBackTrace as $_aDebugInfo ) { |
|
85 | 85 | $_sCallerFilePath = $_aDebugInfo[ 'file' ]; |
86 | - if ( in_array( $_sCallerFilePath, $_aRedirectedFilePaths ) ) { |
|
86 | + if ( in_array( $_sCallerFilePath, $_aRedirectedFilePaths ) ) { |
|
87 | 87 | continue; |
88 | 88 | } |
89 | 89 | break; // catch the first found item. |
@@ -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 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * but it requires to call the setUp() method in the overridden method so it's not that useful. |
47 | 47 | * @internal |
48 | 48 | */ |
49 | - protected function _setUp() { |
|
49 | + protected function _setUp() { |
|
50 | 50 | $this->setUp(); |
51 | 51 | } |
52 | 52 | |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @since 3.7.0 |
106 | 106 | * @return array The modified sectionsets definition array. |
107 | 107 | */ |
108 | - public function _replyToModifySectionsets( $aSectionsets ) { |
|
108 | + public function _replyToModifySectionsets( $aSectionsets ) { |
|
109 | 109 | |
110 | 110 | return $this->oUtil->addAndApplyFilter( |
111 | 111 | $this, // caller factory object |
@@ -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 |
@@ -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>"; |