@@ -23,12 +23,12 @@ |
||
23 | 23 | * @since 3.0.0 |
24 | 24 | * @deprecated 3.7.0 Use `AdminPageFramework_PageMetaBox` instead. |
25 | 25 | */ |
26 | - public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs=array(), $sContext='normal', $sPriority='default', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
26 | + public function __construct( $sMetaBoxID, $sTitle, $asPageSlugs = array(), $sContext = 'normal', $sPriority = 'default', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
27 | 27 | |
28 | 28 | parent::__construct( $sMetaBoxID, $sTitle, $asPageSlugs, $sContext, $sPriority, $sCapability, $sTextDomain ); |
29 | 29 | |
30 | 30 | $this->oUtil->showDeprecationNotice( |
31 | - 'The class, ' . __CLASS__ . ',', // deprecated item |
|
31 | + 'The class, '.__CLASS__.',', // deprecated item |
|
32 | 32 | 'AdminPageFramework_PageMetaBox' // alternative |
33 | 33 | ); |
34 | 34 |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | * @remark the $_deprecated parameter is just to avoid the PHP strict standards warning. |
30 | 30 | * @internal |
31 | 31 | */ |
32 | - public function _enqueueStyles( $aSRCs, $aCustomArgs=array(), $_deprecated=null ) { |
|
32 | + public function _enqueueStyles( $aSRCs, $aCustomArgs = array(), $_deprecated = null ) { |
|
33 | 33 | |
34 | 34 | $_aHandleIDs = array(); |
35 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
36 | - $_aHandleIDs[] = $this->_enqueueStyle( $_sSRC, $aCustomArgs ); |
|
35 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
36 | + $_aHandleIDs[ ] = $this->_enqueueStyle( $_sSRC, $aCustomArgs ); |
|
37 | 37 | } |
38 | 38 | return $_aHandleIDs; |
39 | 39 | |
@@ -57,9 +57,9 @@ discard block |
||
57 | 57 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
58 | 58 | * @internal |
59 | 59 | */ |
60 | - public function _enqueueStyle( $sSRC, $aCustomArgs=array(), $_deprecated=null ) { |
|
60 | + public function _enqueueStyle( $sSRC, $aCustomArgs = array(), $_deprecated = null ) { |
|
61 | 61 | |
62 | - $sSRC = trim( $sSRC ); |
|
62 | + $sSRC = trim( $sSRC ); |
|
63 | 63 | if ( empty( $sSRC ) ) { |
64 | 64 | return ''; |
65 | 65 | } |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | array( |
77 | 77 | 'sSRC' => $sSRC, |
78 | 78 | 'sType' => 'style', |
79 | - 'handle_id' => 'style_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedStyleIndex ), |
|
79 | + 'handle_id' => 'style_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedStyleIndex ), |
|
80 | 80 | ), |
81 | 81 | self::$_aStructure_EnqueuingResources |
82 | 82 | ); |
83 | 83 | |
84 | 84 | // Store the attributes in another container by url. |
85 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['attributes']; |
|
85 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'attributes' ]; |
|
86 | 86 | |
87 | 87 | return $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ]; |
88 | 88 | |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | * @since 3.0.0 |
95 | 95 | * @remark the $_deprecated parameter is just to avoid the PHP strict standards warning. |
96 | 96 | */ |
97 | - public function _enqueueScripts( $aSRCs, $aCustomArgs=array(), $_deprecated=null ) { |
|
97 | + public function _enqueueScripts( $aSRCs, $aCustomArgs = array(), $_deprecated = null ) { |
|
98 | 98 | |
99 | 99 | $_aHandleIDs = array(); |
100 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
101 | - $_aHandleIDs[] = $this->_enqueueScript( $_sSRC, $aCustomArgs ); |
|
100 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
101 | + $_aHandleIDs[ ] = $this->_enqueueScript( $_sSRC, $aCustomArgs ); |
|
102 | 102 | } |
103 | 103 | return $_aHandleIDs; |
104 | 104 | |
@@ -123,9 +123,9 @@ discard block |
||
123 | 123 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
124 | 124 | * @internal |
125 | 125 | */ |
126 | - public function _enqueueScript( $sSRC, $aCustomArgs=array(), $_deprecated=null ) { |
|
126 | + public function _enqueueScript( $sSRC, $aCustomArgs = array(), $_deprecated = null ) { |
|
127 | 127 | |
128 | - $sSRC = trim( $sSRC ); |
|
128 | + $sSRC = trim( $sSRC ); |
|
129 | 129 | if ( empty( $sSRC ) ) { |
130 | 130 | return ''; |
131 | 131 | } |
@@ -142,13 +142,13 @@ discard block |
||
142 | 142 | array( |
143 | 143 | 'sSRC' => $sSRC, |
144 | 144 | 'sType' => 'script', |
145 | - 'handle_id' => 'script_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedScriptIndex ), |
|
145 | + 'handle_id' => 'script_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedScriptIndex ), |
|
146 | 146 | ), |
147 | 147 | self::$_aStructure_EnqueuingResources |
148 | 148 | ); |
149 | 149 | |
150 | 150 | // Store the attributes in another container by url. |
151 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['attributes']; |
|
151 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'attributes' ]; |
|
152 | 152 | |
153 | 153 | return $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ]; |
154 | 154 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * @since 3.0.0 |
161 | 161 | * @internal |
162 | 162 | */ |
163 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
163 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
164 | 164 | return $this->_enqueueStyle( $sSRC, $aCustomArgs ); |
165 | 165 | } |
166 | 166 | /** |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | * @since 3.0.0 |
170 | 170 | * @internal |
171 | 171 | */ |
172 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
172 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
173 | 173 | return $this->_enqueueScript( $sSRC, $aCustomArgs ); |
174 | 174 | } |
175 | 175 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param string The text domain. Default: `admin-page-framework`. |
46 | 46 | * @return void |
47 | 47 | */ |
48 | - function __construct( $asTaxonomySlug, $sOptionKey='', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
48 | + function __construct( $asTaxonomySlug, $sOptionKey = '', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
49 | 49 | |
50 | 50 | if ( empty( $asTaxonomySlug ) ) { |
51 | 51 | return; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | // Properties |
55 | 55 | $_sProprtyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
56 | 56 | ? $this->aSubClassNames[ 'oProp' ] |
57 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
57 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
58 | 58 | $this->oProp = new $_sProprtyClassName( |
59 | 59 | $this, |
60 | 60 | get_class( $this ), |
@@ -68,7 +68,7 @@ |
||
68 | 68 | return "{$_aField['field_id']}{$_sKey}"; |
69 | 69 | } |
70 | 70 | |
71 | - /** |
|
71 | + /** |
|
72 | 72 | * Adds input fields |
73 | 73 | * |
74 | 74 | * @internal |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | '', |
48 | 48 | "[{$_sKey}]" |
49 | 49 | ); |
50 | - return $_aField['field_id'] . $_sKey; |
|
50 | + return $_aField[ 'field_id' ].$_sKey; |
|
51 | 51 | |
52 | 52 | } |
53 | 53 | /** |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | '', |
66 | 66 | "|{$_sKey}" |
67 | 67 | ); |
68 | - return "{$_aField['field_id']}{$_sKey}"; |
|
68 | + return "{$_aField[ 'field_id' ]}{$_sKey}"; |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $_aOutput = array(); |
116 | 116 | |
117 | 117 | // Set nonce. |
118 | - $_aOutput[] = wp_nonce_field( |
|
118 | + $_aOutput[ ] = wp_nonce_field( |
|
119 | 119 | $this->oProp->sClassHash, |
120 | 120 | $this->oProp->sClassHash, |
121 | 121 | true, |
@@ -126,17 +126,17 @@ discard block |
||
126 | 126 | $this->_setOptionArray( $iTermID, $this->oProp->sOptionKey ); |
127 | 127 | |
128 | 128 | // Get the field outputs |
129 | - $_aOutput[] = $this->oForm->get( $bRenderTableRow ); |
|
129 | + $_aOutput[ ] = $this->oForm->get( $bRenderTableRow ); |
|
130 | 130 | |
131 | 131 | // Filter the output |
132 | 132 | $_sOutput = $this->oUtil->addAndApplyFilters( |
133 | 133 | $this, |
134 | - 'content_' . $this->oProp->sClassName, |
|
134 | + 'content_'.$this->oProp->sClassName, |
|
135 | 135 | $this->content( implode( PHP_EOL, $_aOutput ) ) |
136 | 136 | ); |
137 | 137 | |
138 | 138 | // Do action |
139 | - $this->oUtil->addAndDoActions( $this, 'do_' . $this->oProp->sClassName, $this ); |
|
139 | + $this->oUtil->addAndDoActions( $this, 'do_'.$this->oProp->sClassName, $this ); |
|
140 | 140 | |
141 | 141 | return $_sOutput; |
142 | 142 | |
@@ -155,8 +155,8 @@ discard block |
||
155 | 155 | public function _replyToPrintColumnCell( $vValue, $sColumnSlug, $sTermID ) { |
156 | 156 | |
157 | 157 | $_sCellHTML = ''; |
158 | - if ( isset( $_GET['taxonomy'] ) && $_GET['taxonomy'] ) { |
|
159 | - $_sCellHTML = $this->oUtil->addAndApplyFilter( $this, "cell_{$_GET['taxonomy']}", $vValue, $sColumnSlug, $sTermID ); |
|
158 | + if ( isset( $_GET[ 'taxonomy' ] ) && $_GET[ 'taxonomy' ] ) { |
|
159 | + $_sCellHTML = $this->oUtil->addAndApplyFilter( $this, "cell_{$_GET[ 'taxonomy' ]}", $vValue, $sColumnSlug, $sTermID ); |
|
160 | 160 | } |
161 | 161 | $_sCellHTML = $this->oUtil->addAndApplyFilter( $this, "cell_{$this->oProp->sClassName}", $_sCellHTML, $sColumnSlug, $sTermID ); |
162 | 162 | $_sCellHTML = $this->oUtil->addAndApplyFilter( $this, "cell_{$this->oProp->sClassName}_{$sColumnSlug}", $_sCellHTML, $sTermID ); // 3.0.2+ |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | parent::__construct( $oProp ); |
28 | 28 | |
29 | - if ( ! $this->oProp->bIsAdmin ) { |
|
29 | + if ( !$this->oProp->bIsAdmin ) { |
|
30 | 30 | return; |
31 | 31 | } |
32 | 32 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | ); |
38 | 38 | |
39 | 39 | add_action( |
40 | - 'set_up_' . $this->oProp->sClassName, |
|
40 | + 'set_up_'.$this->oProp->sClassName, |
|
41 | 41 | array( $this, '_replyToSetUpHooks' ) |
42 | 42 | ); |
43 | 43 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | protected function _isInThePage() { |
56 | 56 | |
57 | - if ( ! $this->oProp->bIsAdmin ) { |
|
57 | + if ( !$this->oProp->bIsAdmin ) { |
|
58 | 58 | return false; |
59 | 59 | } |
60 | 60 | |
@@ -62,11 +62,11 @@ discard block |
||
62 | 62 | return $this->_isValidAjaxReferrer(); |
63 | 63 | } |
64 | 64 | |
65 | - if ( ! in_array( $this->oProp->sPageNow, array( 'edit-tags.php', 'term.php' ) ) ) { |
|
65 | + if ( !in_array( $this->oProp->sPageNow, array( 'edit-tags.php', 'term.php' ) ) ) { |
|
66 | 66 | return false; |
67 | 67 | } |
68 | 68 | |
69 | - if ( isset( $_GET[ 'taxonomy' ] ) && ! in_array( $_GET[ 'taxonomy' ], $this->oProp->aTaxonomySlugs ) ) { |
|
69 | + if ( isset( $_GET[ 'taxonomy' ] ) && !in_array( $_GET[ 'taxonomy' ], $this->oProp->aTaxonomySlugs ) ) { |
|
70 | 70 | return false; |
71 | 71 | } |
72 | 72 | |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | parse_str( $_aReferrer[ 'query' ], $_aQuery ); |
87 | 87 | |
88 | 88 | $_sBaseName = basename( $_aReferrer[ 'path' ] ); |
89 | - if ( ! in_array( $_sBaseName, array( 'edit-tags.php', 'term.php' ) ) ) { |
|
89 | + if ( !in_array( $_sBaseName, array( 'edit-tags.php', 'term.php' ) ) ) { |
|
90 | 90 | return false; |
91 | 91 | } |
92 | 92 | $_sTaxonomy = $this->oUtil->getElement( $this->oProp->aQuery, array( 'taxonomy' ), '' ); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function _replyToSetUpHooks( $oFactory ) { |
105 | 105 | |
106 | - foreach( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
106 | + foreach ( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
107 | 107 | |
108 | 108 | // Validation callbacks need to be set regardless of whether the current page is edit-tags.php or not. |
109 | 109 | add_action( "created_{$_sTaxonomySlug}", array( $this, '_replyToValidateOptions' ), 10, 2 ); |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | return $this->_getFilteredColumnsByFilterPrefix( |
54 | 54 | $this->oUtil->getAsArray( $aColumns ), |
55 | 55 | 'columns_', |
56 | - isset( $_GET['taxonomy'] ) // in ajax, $_GET is not even set. |
|
57 | - ? $_GET['taxonomy'] |
|
56 | + isset( $_GET[ 'taxonomy' ] ) // in ajax, $_GET is not even set. |
|
57 | + ? $_GET[ 'taxonomy' ] |
|
58 | 58 | : '' |
59 | 59 | ); |
60 | 60 | } |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | return $this->_getFilteredColumnsByFilterPrefix( |
72 | 72 | $this->oUtil->getAsArray( $aSortableColumns ), |
73 | 73 | 'sortable_columns_', |
74 | - isset( $_GET['taxonomy'] ) // in ajax, $_GET is not even set. |
|
75 | - ? $_GET['taxonomy'] |
|
74 | + isset( $_GET[ 'taxonomy' ] ) // in ajax, $_GET is not even set. |
|
75 | + ? $_GET[ 'taxonomy' ] |
|
76 | 76 | : '' |
77 | 77 | ); |
78 | 78 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | if ( $sTaxonomy ) { |
87 | 87 | $aColumns = $this->oUtil->addAndApplyFilter( |
88 | 88 | $this, |
89 | - "{$sFilterPrefix}{$_GET['taxonomy']}", |
|
89 | + "{$sFilterPrefix}{$_GET[ 'taxonomy' ]}", |
|
90 | 90 | $aColumns |
91 | 91 | ); |
92 | 92 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | * @since 3.7.0 No longer sets the value to `$this-oProp->aOptions` but to the form peoperty. |
124 | 124 | * @internal |
125 | 125 | */ |
126 | - protected function _setOptionArray( $iTermID=null, $sOptionKey ) { |
|
126 | + protected function _setOptionArray( $iTermID = null, $sOptionKey ) { |
|
127 | 127 | $this->oForm->aSavedData = $this->_getSavedFormData( |
128 | 128 | $iTermID, |
129 | 129 | $sOptionKey |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | return $this->oUtil->addAndApplyFilter( |
141 | 141 | $this, // the caller factory object |
142 | - 'options_' . $this->oProp->sClassName, |
|
142 | + 'options_'.$this->oProp->sClassName, |
|
143 | 143 | $this->_getSavedTermFormData( $iTermID, $sOptionKey ) |
144 | 144 | // @todo maybe pass the term id because the user will not know whihch form data it is |
145 | 145 | ); |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | */ |
174 | 174 | public function _replyToValidateOptions( $iTermID ) { |
175 | 175 | |
176 | - if ( ! $this->_shouldProceedValidation() ) { |
|
176 | + if ( !$this->_shouldProceedValidation() ) { |
|
177 | 177 | return; |
178 | 178 | } |
179 | 179 | |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | $_aSubmittedFormData = $this->oForm->getSubmittedData( $_POST ); |
183 | 183 | $_aSubmittedFormData = $this->oUtil->addAndApplyFilters( |
184 | 184 | $this, |
185 | - 'validation_' . $this->oProp->sClassName, |
|
185 | + 'validation_'.$this->oProp->sClassName, |
|
186 | 186 | call_user_func_array( |
187 | 187 | array( $this, 'validate' ), // triggers __call() |
188 | 188 | array( $_aSubmittedFormData, $_aSavedFormData, $this ) |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | |
194 | 194 | // @todo Examine whether it is appropriate to merge recursivly |
195 | 195 | // as some fields will have a problem such as select with multiple options. |
196 | - $_aTaxonomyFormData[ $iTermID ] = $this->oUtil->uniteArrays( |
|
196 | + $_aTaxonomyFormData[ $iTermID ] = $this->oUtil->uniteArrays( |
|
197 | 197 | $_aSubmittedFormData, |
198 | 198 | $_aSavedFormData |
199 | 199 | ); |
@@ -215,11 +215,11 @@ discard block |
||
215 | 215 | */ |
216 | 216 | protected function _shouldProceedValidation() { |
217 | 217 | |
218 | - if ( ! isset( $_POST[ $this->oProp->sClassHash ] ) ) { |
|
218 | + if ( !isset( $_POST[ $this->oProp->sClassHash ] ) ) { |
|
219 | 219 | |
220 | 220 | return false; |
221 | 221 | } |
222 | - if ( ! wp_verify_nonce( $_POST[ $this->oProp->sClassHash ], $this->oProp->sClassHash ) ) { |
|
222 | + if ( !wp_verify_nonce( $_POST[ $this->oProp->sClassHash ], $this->oProp->sClassHash ) ) { |
|
223 | 223 | return false; |
224 | 224 | } |
225 | 225 | return true; |
@@ -28,11 +28,11 @@ discard block |
||
28 | 28 | * @since 3.2.0 |
29 | 29 | * @internal |
30 | 30 | */ |
31 | - public function _enqueueStyles( $aSRCs, $aCustomArgs=array() ) { |
|
31 | + public function _enqueueStyles( $aSRCs, $aCustomArgs = array() ) { |
|
32 | 32 | |
33 | 33 | $_aHandleIDs = array(); |
34 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
35 | - $_aHandleIDs[] = $this->_enqueueStyle( $_sSRC, $aCustomArgs ); |
|
34 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
35 | + $_aHandleIDs[ ] = $this->_enqueueStyle( $_sSRC, $aCustomArgs ); |
|
36 | 36 | } |
37 | 37 | return $_aHandleIDs; |
38 | 38 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
48 | 48 | * @internal |
49 | 49 | */ |
50 | - public function _enqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
50 | + public function _enqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
51 | 51 | |
52 | 52 | $sSRC = trim( $sSRC ); |
53 | 53 | if ( empty( $sSRC ) ) { |
@@ -66,13 +66,13 @@ discard block |
||
66 | 66 | array( |
67 | 67 | 'sSRC' => $sSRC, |
68 | 68 | 'sType' => 'style', |
69 | - 'handle_id' => 'style_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedStyleIndex ), |
|
69 | + 'handle_id' => 'style_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedStyleIndex ), |
|
70 | 70 | ), |
71 | 71 | self::$_aStructure_EnqueuingResources |
72 | 72 | ); |
73 | 73 | |
74 | 74 | // Store the attributes in another container by url. |
75 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['attributes']; |
|
75 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'attributes' ]; |
|
76 | 76 | |
77 | 77 | return $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ]; |
78 | 78 | |
@@ -84,11 +84,11 @@ discard block |
||
84 | 84 | * @since 3.2.0 |
85 | 85 | * @internal |
86 | 86 | */ |
87 | - public function _enqueueScripts( $aSRCs, $aCustomArgs=array() ) { |
|
87 | + public function _enqueueScripts( $aSRCs, $aCustomArgs = array() ) { |
|
88 | 88 | |
89 | 89 | $_aHandleIDs = array(); |
90 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
91 | - $_aHandleIDs[] = $this->_enqueueScript( $_sSRC, $aCustomArgs ); |
|
90 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
91 | + $_aHandleIDs[ ] = $this->_enqueueScript( $_sSRC, $aCustomArgs ); |
|
92 | 92 | } |
93 | 93 | return $_aHandleIDs; |
94 | 94 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
104 | 104 | * @internal |
105 | 105 | */ |
106 | - public function _enqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
106 | + public function _enqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
107 | 107 | |
108 | 108 | $sSRC = trim( $sSRC ); |
109 | 109 | if ( empty( $sSRC ) ) { return ''; } |
@@ -120,13 +120,13 @@ discard block |
||
120 | 120 | array( |
121 | 121 | 'sSRC' => $sSRC, |
122 | 122 | 'sType' => 'script', |
123 | - 'handle_id' => 'script_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedScriptIndex ), |
|
123 | + 'handle_id' => 'script_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedScriptIndex ), |
|
124 | 124 | ), |
125 | 125 | self::$_aStructure_EnqueuingResources |
126 | 126 | ); |
127 | 127 | |
128 | 128 | // Store the attributes in another container by url. |
129 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['attributes']; |
|
129 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'attributes' ]; |
|
130 | 130 | |
131 | 131 | return $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ]; |
132 | 132 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @since 3.2.0 |
141 | 141 | * @internal |
142 | 142 | */ |
143 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
143 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
144 | 144 | return $this->_enqueueStyle( $sSRC, $aCustomArgs ); |
145 | 145 | } |
146 | 146 | /** |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * @since 3.2.0 |
151 | 151 | * @internal |
152 | 152 | */ |
153 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
153 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
154 | 154 | return $this->_enqueueScript( $sSRC, $aCustomArgs ); |
155 | 155 | } |
156 | 156 |
@@ -19,22 +19,22 @@ |
||
19 | 19 | abstract class AdminPageFramework_Widget_Controller extends AdminPageFramework_Widget_View { |
20 | 20 | |
21 | 21 | /** |
22 | - * The method for necessary set-ups. |
|
23 | - * |
|
24 | - * <h4>Example</h4> |
|
25 | - * <code> |
|
26 | - * public function setUp() { |
|
27 | - * $this->setArguments( |
|
28 | - * array( |
|
29 | - * 'description' => __( 'This is a sample widget with built-in field types created by Admin Page Framework.', 'admin-page-framework-demo' ), |
|
30 | - * ) |
|
31 | - * ); |
|
32 | - * } |
|
33 | - * </code> |
|
34 | - * |
|
35 | - * @abstract |
|
36 | - * @since 3.2.0 |
|
37 | - */ |
|
22 | + * The method for necessary set-ups. |
|
23 | + * |
|
24 | + * <h4>Example</h4> |
|
25 | + * <code> |
|
26 | + * public function setUp() { |
|
27 | + * $this->setArguments( |
|
28 | + * array( |
|
29 | + * 'description' => __( 'This is a sample widget with built-in field types created by Admin Page Framework.', 'admin-page-framework-demo' ), |
|
30 | + * ) |
|
31 | + * ); |
|
32 | + * } |
|
33 | + * </code> |
|
34 | + * |
|
35 | + * @abstract |
|
36 | + * @since 3.2.0 |
|
37 | + */ |
|
38 | 38 | public function setUp() {} |
39 | 39 | |
40 | 40 | /** |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * @since 3.2.0 |
128 | 128 | * @internal Temporarily marked internal |
129 | 129 | */ |
130 | - public function enqueueStyles( $aSRCs, $aCustomArgs=array() ) { |
|
130 | + public function enqueueStyles( $aSRCs, $aCustomArgs = array() ) { |
|
131 | 131 | if ( method_exists( $this->oResource, '_enqueueStyles' ) ) { |
132 | 132 | return $this->oResource->_enqueueStyles( $aSRCs, array( $this->oProp->sPostType ), $aCustomArgs ); |
133 | 133 | } |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @since 3.2.0 |
141 | 141 | * @internal Temporarily marked internal |
142 | 142 | */ |
143 | - public function enqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
143 | + public function enqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
144 | 144 | if ( method_exists( $this->oResource, '_enqueueStyle' ) ) { |
145 | 145 | return $this->oResource->_enqueueStyle( $sSRC, array( $this->oProp->sPostType ), $aCustomArgs ); |
146 | 146 | } |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @since 3.2.0 |
154 | 154 | * @internal Temporarily marked internal |
155 | 155 | */ |
156 | - public function enqueueScripts( $aSRCs, $aCustomArgs=array() ) { |
|
156 | + public function enqueueScripts( $aSRCs, $aCustomArgs = array() ) { |
|
157 | 157 | if ( method_exists( $this->oResource, '_enqueueScripts' ) ) { |
158 | 158 | return $this->oResource->_enqueueScripts( $aSRCs, array( $this->oProp->sPostType ), $aCustomArgs ); |
159 | 159 | } |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | * @since 3.2.0 |
167 | 167 | * @internal Temporarily marked internal |
168 | 168 | */ |
169 | - public function enqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
169 | + public function enqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
170 | 170 | if ( method_exists( $this->oResource, '_enqueueScript' ) ) { |
171 | 171 | return $this->oResource->_enqueueScript( $sSRC, array( $this->oProp->sPostType ), $aCustomArgs ); |
172 | 172 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @see https://codex.wordpress.org/Function_Reference/wp_register_sidebar_widget |
188 | 188 | * @return void |
189 | 189 | */ |
190 | - protected function setArguments( array $aArguments=array() ) { |
|
190 | + protected function setArguments( array $aArguments = array() ) { |
|
191 | 191 | $this->oProp->aWidgetArguments = $aArguments; |
192 | 192 | } |
193 | 193 |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | |
37 | 37 | if ( $this->oProp->bIsAdmin ) { |
38 | 38 | add_filter( |
39 | - 'validation_' . $this->oProp->sClassName, |
|
39 | + 'validation_'.$this->oProp->sClassName, |
|
40 | 40 | array( $this, '_replyToSortInputs' ), |
41 | - 1, // set a high priority |
|
41 | + 1, // set a high priority |
|
42 | 42 | 3 // number of parameters |
43 | 43 | ); |
44 | 44 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function _replyToRegisterWidget() { |
110 | 110 | |
111 | - if ( ! is_object( $GLOBALS[ 'wp_widget_factory' ] ) ) { |
|
111 | + if ( !is_object( $GLOBALS[ 'wp_widget_factory' ] ) ) { |
|
112 | 112 | return; |
113 | 113 | } |
114 | 114 |