@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | if ( in_array( $oProp->sClassName, self::$aClassNames ) ) |
31 | 31 | return self::$_oInstance; |
32 | 32 | |
33 | - self::$aClassNames[] = $oProp->sClassName; |
|
33 | + self::$aClassNames[ ] = $oProp->sClassName; |
|
34 | 34 | self::$_oInstance = new AdminPageFramework_PageLoadInfo_PostType( $oProp, $oMsg ); |
35 | 35 | |
36 | 36 | return self::$_oInstance; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | public function _replyToSetPageLoadInfoInFooter() { |
45 | 45 | |
46 | 46 | // Some users sets $_GET['post_type'] element even in regular admin pages. In that case, do not load the style to avoid duplicates. |
47 | - if ( isset( $_GET['page'] ) && $_GET['page'] ) { return; } |
|
47 | + if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] ) { return; } |
|
48 | 48 | |
49 | 49 | // For post type pages |
50 | 50 | if ( |
@@ -27,8 +27,9 @@ |
||
27 | 27 | */ |
28 | 28 | public static function instantiate( $oProp, $oMsg ) { |
29 | 29 | |
30 | - if ( in_array( $oProp->sClassName, self::$aClassNames ) ) |
|
31 | - return self::$_oInstance; |
|
30 | + if ( in_array( $oProp->sClassName, self::$aClassNames ) ) { |
|
31 | + return self::$_oInstance; |
|
32 | + } |
|
32 | 33 | |
33 | 34 | self::$aClassNames[] = $oProp->sClassName; |
34 | 35 | self::$_oInstance = new AdminPageFramework_PageLoadInfo_PostType( $oProp, $oMsg ); |
@@ -21,6 +21,6 @@ |
||
21 | 21 | * @extends AdminPageFramework_Form |
22 | 22 | * @internal |
23 | 23 | */ |
24 | -class AdminPageFramework_Form_post_type extends AdminPageFramework_Form { |
|
24 | +class AdminPageFramework_Form_post_type extends AdminPageFramework_Form { |
|
25 | 25 | public $sStructureType = 'post_type'; |
26 | 26 | } |
27 | 27 | \ No newline at end of file |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | * @param string The text domain. Default: `admin-page-framework`. |
47 | 47 | * @return void |
48 | 48 | */ |
49 | - function __construct( $asTaxonomySlug, $sOptionKey='', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
49 | + function __construct( $asTaxonomySlug, $sOptionKey = '', $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
50 | 50 | |
51 | 51 | if ( empty( $asTaxonomySlug ) ) { |
52 | 52 | // @todo trigger a PHP warning |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | } |
55 | 55 | |
56 | 56 | // Properties |
57 | - $this->oProp = new AdminPageFramework_Property_TaxonomyField( |
|
57 | + $this->oProp = new AdminPageFramework_Property_TaxonomyField( |
|
58 | 58 | $this, |
59 | 59 | get_class( $this ), |
60 | 60 | $sCapability, |
@@ -48,7 +48,7 @@ |
||
48 | 48 | */ |
49 | 49 | function __construct( $asTaxonomySlug, $sOptionKey='', $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
50 | 50 | |
51 | - if ( empty( $asTaxonomySlug ) ) { |
|
51 | + if ( empty( $asTaxonomySlug ) ) { |
|
52 | 52 | // @todo trigger a PHP warning |
53 | 53 | return; |
54 | 54 | } |
@@ -54,8 +54,8 @@ discard block |
||
54 | 54 | return $this->_getFilteredColumnsByFilterPrefix( |
55 | 55 | $this->oUtil->getAsArray( $aColumns ), |
56 | 56 | 'columns_', |
57 | - isset( $_GET['taxonomy'] ) // in ajax, $_GET is not even set. |
|
58 | - ? $_GET['taxonomy'] |
|
57 | + isset( $_GET[ 'taxonomy' ] ) // in ajax, $_GET is not even set. |
|
58 | + ? $_GET[ 'taxonomy' ] |
|
59 | 59 | : '' |
60 | 60 | ); |
61 | 61 | } |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | return $this->_getFilteredColumnsByFilterPrefix( |
73 | 73 | $this->oUtil->getAsArray( $aSortableColumns ), |
74 | 74 | 'sortable_columns_', |
75 | - isset( $_GET['taxonomy'] ) // in ajax, $_GET is not even set. |
|
76 | - ? $_GET['taxonomy'] |
|
75 | + isset( $_GET[ 'taxonomy' ] ) // in ajax, $_GET is not even set. |
|
76 | + ? $_GET[ 'taxonomy' ] |
|
77 | 77 | : '' |
78 | 78 | ); |
79 | 79 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | if ( $sTaxonomy ) { |
88 | 88 | $aColumns = $this->oUtil->addAndApplyFilter( |
89 | 89 | $this, |
90 | - "{$sFilterPrefix}{$_GET['taxonomy']}", |
|
90 | + "{$sFilterPrefix}{$_GET[ 'taxonomy' ]}", |
|
91 | 91 | $aColumns |
92 | 92 | ); |
93 | 93 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | * @since DEVVER No longer sets the value to `$this-oProp->aOptions` but to the form peoperty. |
125 | 125 | * @internal |
126 | 126 | */ |
127 | - protected function _setOptionArray( $iTermID=null, $sOptionKey ) { |
|
127 | + protected function _setOptionArray( $iTermID = null, $sOptionKey ) { |
|
128 | 128 | $this->oForm->aSavedData = $this->_getSavedFormData( |
129 | 129 | $iTermID, |
130 | 130 | $sOptionKey |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | return $this->oUtil->addAndApplyFilter( |
142 | 142 | $this, // the caller factory object |
143 | - 'options_' . $this->oProp->sClassName, |
|
143 | + 'options_'.$this->oProp->sClassName, |
|
144 | 144 | $this->_getSavedTermFormData( $iTermID, $sOptionKey ) |
145 | 145 | // @todo maybe pass the term id because the user will not know whihch form data is |
146 | 146 | ); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function _replyToValidateOptions( $iTermID ) { |
176 | 176 | |
177 | - if ( ! $this->_shouldProceedValidation() ) { |
|
177 | + if ( !$this->_shouldProceedValidation() ) { |
|
178 | 178 | return; |
179 | 179 | } |
180 | 180 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $_aSubmittedFormData = $this->oForm->getSubmittedData( $_POST ); |
184 | 184 | $_aSubmittedFormData = $this->oUtil->addAndApplyFilters( |
185 | 185 | $this, |
186 | - 'validation_' . $this->oProp->sClassName, |
|
186 | + 'validation_'.$this->oProp->sClassName, |
|
187 | 187 | call_user_func_array( |
188 | 188 | array( $this, 'validate' ), // triggers __call() |
189 | 189 | array( $_aSubmittedFormData, $_aSavedFormData, $this ) |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | |
195 | 195 | // @todo Examine whether it is appropriate to merge recursivly |
196 | 196 | // as some fields will have a problem such as select with multiple options. |
197 | - $_aTaxonomyFormData[ $iTermID ] = $this->oUtil->uniteArrays( |
|
197 | + $_aTaxonomyFormData[ $iTermID ] = $this->oUtil->uniteArrays( |
|
198 | 198 | $_aSubmittedFormData, |
199 | 199 | $_aSavedFormData |
200 | 200 | ); |
@@ -215,11 +215,11 @@ discard block |
||
215 | 215 | */ |
216 | 216 | private 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; |
@@ -215,7 +215,7 @@ |
||
215 | 215 | */ |
216 | 216 | private 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 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | return false; |
57 | 57 | } |
58 | 58 | |
59 | - if ( isset( $_GET['taxonomy'] ) && ! in_array( $_GET['taxonomy'], $this->oProp->aTaxonomySlugs ) ) { |
|
59 | + if ( isset( $_GET[ 'taxonomy' ] ) && !in_array( $_GET[ 'taxonomy' ], $this->oProp->aTaxonomySlugs ) ) { |
|
60 | 60 | return false; |
61 | 61 | } |
62 | 62 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function _replyToDetermineToLoad( /* $oScreen */ ) { |
76 | 76 | |
77 | - if ( ! $this->_isInThePage() ) { |
|
77 | + if ( !$this->_isInThePage() ) { |
|
78 | 78 | return; |
79 | 79 | } |
80 | 80 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $this |
88 | 88 | ); |
89 | 89 | |
90 | - foreach( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
90 | + foreach ( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
91 | 91 | |
92 | 92 | /* Validation callbacks need to be set regardless of whether the current page is edit-tags.php or not */ |
93 | 93 | add_action( "created_{$_sTaxonomySlug}", array( $this, '_replyToValidateOptions' ), 10, 2 ); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | return true; |
53 | 53 | } |
54 | 54 | |
55 | - if ( 'edit-tags.php' != $this->oProp->sPageNow ) { |
|
55 | + if ( 'edit-tags.php' != $this->oProp->sPageNow ) { |
|
56 | 56 | return false; |
57 | 57 | } |
58 | 58 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function _replyToDetermineToLoad( /* $oScreen */ ) { |
76 | 76 | |
77 | - if ( ! $this->_isInThePage() ) { |
|
77 | + if ( ! $this->_isInThePage() ) { |
|
78 | 78 | return; |
79 | 79 | } |
80 | 80 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $this |
88 | 88 | ); |
89 | 89 | |
90 | - foreach( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
90 | + foreach( $this->oProp->aTaxonomySlugs as $_sTaxonomySlug ) { |
|
91 | 91 | |
92 | 92 | /* Validation callbacks need to be set regardless of whether the current page is edit-tags.php or not */ |
93 | 93 | add_action( "created_{$_sTaxonomySlug}", array( $this, '_replyToValidateOptions' ), 10, 2 ); |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | * @remark the $_deprecated parameter is just to avoid the PHP strict standards warning. |
31 | 31 | * @internal |
32 | 32 | */ |
33 | - public function _enqueueStyles( $aSRCs, $aCustomArgs=array(), $_deprecated=null ) { |
|
33 | + public function _enqueueStyles( $aSRCs, $aCustomArgs = array(), $_deprecated = null ) { |
|
34 | 34 | |
35 | 35 | $_aHandleIDs = array(); |
36 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
37 | - $_aHandleIDs[] = $this->_enqueueStyle( $_sSRC, $aCustomArgs ); |
|
36 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
37 | + $_aHandleIDs[ ] = $this->_enqueueStyle( $_sSRC, $aCustomArgs ); |
|
38 | 38 | } |
39 | 39 | return $_aHandleIDs; |
40 | 40 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
59 | 59 | * @internal |
60 | 60 | */ |
61 | - public function _enqueueStyle( $sSRC, $aCustomArgs=array(), $_deprecated=null ) { |
|
61 | + public function _enqueueStyle( $sSRC, $aCustomArgs = array(), $_deprecated = null ) { |
|
62 | 62 | |
63 | 63 | $sSRC = trim( $sSRC ); |
64 | 64 | if ( empty( $sSRC ) ) { return ''; } |
@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | array( |
74 | 74 | 'sSRC' => $sSRC, |
75 | 75 | 'sType' => 'style', |
76 | - 'handle_id' => 'style_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedStyleIndex ), |
|
76 | + 'handle_id' => 'style_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedStyleIndex ), |
|
77 | 77 | ), |
78 | 78 | self::$_aStructure_EnqueuingResources |
79 | 79 | ); |
80 | 80 | |
81 | 81 | // Store the attributes in another container by url. |
82 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['attributes']; |
|
82 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'attributes' ]; |
|
83 | 83 | |
84 | 84 | return $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ]; |
85 | 85 | |
@@ -91,11 +91,11 @@ discard block |
||
91 | 91 | * @since 3.0.0 |
92 | 92 | * @remark the $_deprecated parameter is just to avoid the PHP strict standards warning. |
93 | 93 | */ |
94 | - public function _enqueueScripts( $aSRCs, $aCustomArgs=array(), $_deprecated=null ) { |
|
94 | + public function _enqueueScripts( $aSRCs, $aCustomArgs = array(), $_deprecated = null ) { |
|
95 | 95 | |
96 | 96 | $_aHandleIDs = array(); |
97 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
98 | - $_aHandleIDs[] = $this->_enqueueScript( $_sSRC, $aCustomArgs ); |
|
97 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
98 | + $_aHandleIDs[ ] = $this->_enqueueScript( $_sSRC, $aCustomArgs ); |
|
99 | 99 | } |
100 | 100 | return $_aHandleIDs; |
101 | 101 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
121 | 121 | * @internal |
122 | 122 | */ |
123 | - public function _enqueueScript( $sSRC, $aCustomArgs=array(), $_deprecated=null ) { |
|
123 | + public function _enqueueScript( $sSRC, $aCustomArgs = array(), $_deprecated = null ) { |
|
124 | 124 | |
125 | 125 | $sSRC = trim( $sSRC ); |
126 | 126 | if ( empty( $sSRC ) ) { return ''; } |
@@ -135,13 +135,13 @@ discard block |
||
135 | 135 | array( |
136 | 136 | 'sSRC' => $sSRC, |
137 | 137 | 'sType' => 'script', |
138 | - 'handle_id' => 'script_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedScriptIndex ), |
|
138 | + 'handle_id' => 'script_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedScriptIndex ), |
|
139 | 139 | ), |
140 | 140 | self::$_aStructure_EnqueuingResources |
141 | 141 | ); |
142 | 142 | |
143 | 143 | // Store the attributes in another container by url. |
144 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['attributes']; |
|
144 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'attributes' ]; |
|
145 | 145 | |
146 | 146 | return $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ]; |
147 | 147 | |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | * @since 3.0.0 |
154 | 154 | * @internal |
155 | 155 | */ |
156 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
156 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
157 | 157 | return $this->_enqueueStyle( $sSRC, $aCustomArgs ); |
158 | 158 | } |
159 | 159 | /** |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | * @since 3.0.0 |
163 | 163 | * @internal |
164 | 164 | */ |
165 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
165 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
166 | 166 | return $this->_enqueueScript( $sSRC, $aCustomArgs ); |
167 | 167 | } |
168 | 168 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | '' // default value |
38 | 38 | ); |
39 | 39 | |
40 | - if ( ! $this->canUserView( $this->sCapability ) ) { |
|
40 | + if ( !$this->canUserView( $this->sCapability ) ) { |
|
41 | 41 | return ''; |
42 | 42 | } |
43 | 43 |
@@ -38,13 +38,13 @@ |
||
38 | 38 | * @since 3.5.0 |
39 | 39 | * @todo Examine the appropriate default capability level. |
40 | 40 | */ |
41 | - public function __construct( $sCapability='edit_user', $sTextDomain='admin-page-framework' ) { |
|
41 | + public function __construct( $sCapability = 'edit_user', $sTextDomain = 'admin-page-framework' ) { |
|
42 | 42 | |
43 | 43 | $this->oProp = new AdminPageFramework_Property_UserMeta( |
44 | - $this, // the caller object |
|
45 | - get_class( $this ), // the caller class name |
|
46 | - $sCapability, // the capability level |
|
47 | - $sTextDomain, // the text domain |
|
44 | + $this, // the caller object |
|
45 | + get_class( $this ), // the caller class name |
|
46 | + $sCapability, // the capability level |
|
47 | + $sTextDomain, // the text domain |
|
48 | 48 | self::$_sStructureType // the fields type |
49 | 49 | ); |
50 | 50 |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @since 3.5.0 |
68 | 68 | */ |
69 | - public function enqueueStyles( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
69 | + public function enqueueStyles( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
70 | 70 | return $this->oResource->_enqueueStyles( $aSRCs, $aPostTypes, $aCustomArgs ); |
71 | 71 | } |
72 | 72 | /** |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | * @param array (optional) The argument array for more advanced parameters. |
90 | 90 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
91 | 91 | */ |
92 | - public function enqueueStyle( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
92 | + public function enqueueStyle( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
93 | 93 | return $this->oResource->_enqueueStyle( $sSRC, $aPostTypes, $aCustomArgs ); |
94 | 94 | } |
95 | 95 | /** |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @since 3.5.0 |
99 | 99 | */ |
100 | - public function enqueueScripts( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
100 | + public function enqueueScripts( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
101 | 101 | return $this->oResource->_enqueueScripts( $aSRCs, $aPostTypes, $aCustomArgs ); |
102 | 102 | } |
103 | 103 | /** |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | * @param array (optional) The argument array for more advanced parameters. |
133 | 133 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
134 | 134 | */ |
135 | - public function enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
135 | + public function enqueueScript( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
136 | 136 | return $this->oResource->_enqueueScript( $sSRC, $aPostTypes, $aCustomArgs ); |
137 | 137 | } |
138 | 138 |
@@ -132,7 +132,7 @@ |
||
132 | 132 | * @param array (optional) The argument array for more advanced parameters. |
133 | 133 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
134 | 134 | */ |
135 | - public function enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
135 | + public function enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
136 | 136 | return $this->oResource->_enqueueScript( $sSRC, $aPostTypes, $aCustomArgs ); |
137 | 137 | } |
138 | 138 |