@@ -25,10 +25,10 @@ discard block |
||
25 | 25 | * @return numeric |
26 | 26 | * @since 3.7.4 |
27 | 27 | */ |
28 | - static public function getUnusedNumericIndex( $aArray, $nIndex, $iOffset=1 ) { |
|
28 | + static public function getUnusedNumericIndex( $aArray, $nIndex, $iOffset = 1 ) { |
|
29 | 29 | |
30 | 30 | // Check if the order value is not used. |
31 | - if ( ! isset( $aArray[ $nIndex ] ) ) { |
|
31 | + if ( !isset( $aArray[ $nIndex ] ) ) { |
|
32 | 32 | return $nIndex; |
33 | 33 | } |
34 | 34 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | * @return boolean |
44 | 44 | */ |
45 | 45 | static public function isAssociative( array $aArray ) { |
46 | - return array_keys ( $aArray ) !== range( 0, count( $aArray ) - 1 ); |
|
46 | + return array_keys( $aArray ) !== range( 0, count( $aArray ) - 1 ); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | /** |
@@ -76,9 +76,9 @@ discard block |
||
76 | 76 | */ |
77 | 77 | static public function getReadableListOfArray( array $aArray ) { |
78 | 78 | |
79 | - $_aOutput = array(); |
|
80 | - foreach( $aArray as $_sKey => $_vValue ) { |
|
81 | - $_aOutput[] = self::getReadableArrayContents( $_sKey, $_vValue, 32 ) . PHP_EOL; |
|
79 | + $_aOutput = array(); |
|
80 | + foreach ( $aArray as $_sKey => $_vValue ) { |
|
81 | + $_aOutput[ ] = self::getReadableArrayContents( $_sKey, $_vValue, 32 ).PHP_EOL; |
|
82 | 82 | } |
83 | 83 | return implode( PHP_EOL, $_aOutput ); |
84 | 84 | |
@@ -89,37 +89,37 @@ discard block |
||
89 | 89 | * @since 3.3.0 |
90 | 90 | * @return string The generated human readable array contents. |
91 | 91 | */ |
92 | - static public function getReadableArrayContents( $sKey, $vValue, $sLabelCharLengths=16, $iOffset=0 ) { |
|
92 | + static public function getReadableArrayContents( $sKey, $vValue, $sLabelCharLengths = 16, $iOffset = 0 ) { |
|
93 | 93 | |
94 | 94 | $_aOutput = array(); |
95 | - $_aOutput[] = ( $iOffset |
|
96 | - ? str_pad( ' ', $iOffset ) |
|
95 | + $_aOutput[ ] = ( $iOffset |
|
96 | + ? str_pad( ' ', $iOffset ) |
|
97 | 97 | : '' |
98 | 98 | ) |
99 | 99 | . ( $sKey |
100 | - ? '[' . $sKey . ']' |
|
100 | + ? '['.$sKey.']' |
|
101 | 101 | : '' |
102 | 102 | ); |
103 | 103 | |
104 | - if ( ! in_array( gettype( $vValue ), array( 'array', 'object' ) ) ) { |
|
105 | - $_aOutput[] = $vValue; |
|
104 | + if ( !in_array( gettype( $vValue ), array( 'array', 'object' ) ) ) { |
|
105 | + $_aOutput[ ] = $vValue; |
|
106 | 106 | return implode( PHP_EOL, $_aOutput ); |
107 | 107 | } |
108 | 108 | |
109 | 109 | foreach ( $vValue as $_sTitle => $_asDescription ) { |
110 | - if ( ! in_array( gettype( $_asDescription ), array( 'array', 'object' ) ) ) { |
|
111 | - $_aOutput[] = str_pad( ' ', $iOffset ) |
|
110 | + if ( !in_array( gettype( $_asDescription ), array( 'array', 'object' ) ) ) { |
|
111 | + $_aOutput[ ] = str_pad( ' ', $iOffset ) |
|
112 | 112 | . $_sTitle |
113 | 113 | . str_pad( ':', $sLabelCharLengths - self::getStringLength( $_sTitle ) ) |
114 | 114 | . $_asDescription; |
115 | 115 | continue; |
116 | 116 | } |
117 | - $_aOutput[] = str_pad( ' ', $iOffset ) |
|
117 | + $_aOutput[ ] = str_pad( ' ', $iOffset ) |
|
118 | 118 | . $_sTitle |
119 | 119 | . ": {" |
120 | 120 | . self::getReadableArrayContents( '', $_asDescription, 16, $iOffset + 4 ) |
121 | 121 | . PHP_EOL |
122 | - . str_pad( ' ', $iOffset ) . "}"; |
|
122 | + . str_pad( ' ', $iOffset )."}"; |
|
123 | 123 | } |
124 | 124 | return implode( PHP_EOL, $_aOutput ); |
125 | 125 | |
@@ -132,11 +132,11 @@ discard block |
||
132 | 132 | */ |
133 | 133 | static public function getReadableListOfArrayAsHTML( array $aArray ) { |
134 | 134 | |
135 | - $_aOutput = array(); |
|
136 | - foreach( $aArray as $_sKey => $_vValue ) { |
|
137 | - $_aOutput[] = "<ul class='array-contents'>" |
|
135 | + $_aOutput = array(); |
|
136 | + foreach ( $aArray as $_sKey => $_vValue ) { |
|
137 | + $_aOutput[ ] = "<ul class='array-contents'>" |
|
138 | 138 | . self::getReadableArrayContentsHTML( $_sKey, $_vValue ) |
139 | - . "</ul>" . PHP_EOL; |
|
139 | + . "</ul>".PHP_EOL; |
|
140 | 140 | } |
141 | 141 | return implode( PHP_EOL, $_aOutput ); |
142 | 142 | |
@@ -153,25 +153,25 @@ discard block |
||
153 | 153 | $_aOutput = array(); |
154 | 154 | |
155 | 155 | // Title - array key |
156 | - $_aOutput[] = $sKey |
|
157 | - ? "<h3 class='array-key'>" . $sKey . "</h3>" |
|
156 | + $_aOutput[ ] = $sKey |
|
157 | + ? "<h3 class='array-key'>".$sKey."</h3>" |
|
158 | 158 | : ""; |
159 | 159 | |
160 | 160 | // If it does not have a nested array or object, |
161 | - if ( ! in_array( gettype( $vValue ), array( 'array', 'object' ) ) ) { |
|
162 | - $_aOutput[] = "<div class='array-value'>" |
|
161 | + if ( !in_array( gettype( $vValue ), array( 'array', 'object' ) ) ) { |
|
162 | + $_aOutput[ ] = "<div class='array-value'>" |
|
163 | 163 | . html_entity_decode( nl2br( str_replace( ' ', ' ', $vValue ) ), ENT_QUOTES ) |
164 | 164 | . "</div>"; |
165 | - return "<li>" . implode( PHP_EOL, $_aOutput ) . "</li>"; |
|
165 | + return "<li>".implode( PHP_EOL, $_aOutput )."</li>"; |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | // Now it is a nested item. |
169 | 169 | foreach ( $vValue as $_sKey => $_vValue ) { |
170 | - $_aOutput[] = "<ul class='array-contents'>" |
|
170 | + $_aOutput[ ] = "<ul class='array-contents'>" |
|
171 | 171 | . self::getReadableArrayContentsHTML( $_sKey, $_vValue ) |
172 | 172 | . "</ul>"; |
173 | 173 | } |
174 | - return implode( PHP_EOL, $_aOutput ) ; |
|
174 | + return implode( PHP_EOL, $_aOutput ); |
|
175 | 175 | |
176 | 176 | } |
177 | 177 |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | static public function getReadableListOfArray( array $aArray ) { |
59 | 59 | |
60 | 60 | $_aOutput = array(); |
61 | - foreach( $aArray as $_sKey => $_vValue ) { |
|
61 | + foreach( $aArray as $_sKey => $_vValue ) { |
|
62 | 62 | $_aOutput[] = self::getReadableArrayContents( $_sKey, $_vValue, 32 ) . PHP_EOL; |
63 | 63 | } |
64 | 64 | return implode( PHP_EOL, $_aOutput ); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | static public function getReadableListOfArrayAsHTML( array $aArray ) { |
115 | 115 | |
116 | 116 | $_aOutput = array(); |
117 | - foreach( $aArray as $_sKey => $_vValue ) { |
|
117 | + foreach( $aArray as $_sKey => $_vValue ) { |
|
118 | 118 | $_aOutput[] = "<ul class='array-contents'>" |
119 | 119 | . self::getReadableArrayContentsHTML( $_sKey, $_vValue ) |
120 | 120 | . "</ul>" . PHP_EOL; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | } |
148 | 148 | |
149 | 149 | // Now it is a nested item. |
150 | - foreach ( $vValue as $_sKey => $_vValue ) { |
|
150 | + foreach ( $vValue as $_sKey => $_vValue ) { |
|
151 | 151 | $_aOutput[] = "<ul class='array-contents'>" |
152 | 152 | . self::getReadableArrayContentsHTML( $_sKey, $_vValue ) |
153 | 153 | . "</ul>"; |
@@ -170,7 +170,7 @@ |
||
170 | 170 | * @since 3.5.3 |
171 | 171 | * @return string The found page slug. An empty string if not found. |
172 | 172 | * @remark Do not return `null` when not found as some framework methods check the retuened value with `isset()` and if null is given, `isset()` yields `false` while it does `true` for an emtpy string (''). |
173 | - */ |
|
173 | + */ |
|
174 | 174 | public function getCurrentPageSlug() { |
175 | 175 | return isset( $_GET[ 'page' ] ) |
176 | 176 | ? $_GET[ 'page' ] |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | /** |
58 | 58 | * Sets up hooks and properties. |
59 | 59 | */ |
60 | - public function __construct( $oCaller, $sClassName, $sCapability='manage_options', $sTextDomain='admin-page-framework', $sStructureType='page_meta_box' ) { |
|
60 | + public function __construct( $oCaller, $sClassName, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework', $sStructureType = 'page_meta_box' ) { |
|
61 | 61 | |
62 | 62 | // Let them overload. |
63 | 63 | unset( |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | public function _getScreenIDOfPage( $sPageSlug ) { |
107 | 107 | $_oAdminPage = $this->_getOwnerObjectOfPage( $sPageSlug ); |
108 | 108 | return $_oAdminPage |
109 | - ? $_oAdminPage->oProp->aPages[ $sPageSlug ][ '_page_hook' ] . ( is_network_admin() ? '-network' : '' ) |
|
109 | + ? $_oAdminPage->oProp->aPages[ $sPageSlug ][ '_page_hook' ].( is_network_admin() ? '-network' : '' ) |
|
110 | 110 | : ''; |
111 | 111 | } |
112 | 112 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @since 3.0.0 |
117 | 117 | * @return boolean Returns true if it is of framework's added page; otherwise, false. |
118 | 118 | */ |
119 | - public function isPageAdded( $sPageSlug='' ) { |
|
119 | + public function isPageAdded( $sPageSlug = '' ) { |
|
120 | 120 | $_oAdminPage = $this->_getOwnerObjectOfPage( $sPageSlug ); |
121 | 121 | return $_oAdminPage |
122 | 122 | ? $_oAdminPage->oProp->isPageAdded( $sPageSlug ) |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | public function isCurrentTab( $sTabSlug ) { |
134 | 134 | |
135 | 135 | $_sCurrentPageSlug = $this->getElement( $_GET, 'page' ); |
136 | - if ( ! $_sCurrentPageSlug ) { |
|
136 | + if ( !$_sCurrentPageSlug ) { |
|
137 | 137 | return false; |
138 | 138 | } |
139 | 139 | $_sCurrentTabSlug = $this->getElement( |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function getDefaultInPageTab( $sPageSlug ) { |
188 | 188 | |
189 | - if ( ! $sPageSlug ) { |
|
189 | + if ( !$sPageSlug ) { |
|
190 | 190 | return ''; |
191 | 191 | } |
192 | 192 | return ( $_oAdminPage = $this->_getOwnerObjectOfPage( $sPageSlug ) ) |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function getOptionKey( $sPageSlug ) { |
203 | 203 | |
204 | - if ( ! $sPageSlug ) { |
|
204 | + if ( !$sPageSlug ) { |
|
205 | 205 | return ''; |
206 | 206 | } |
207 | 207 | return ( $_oAdminPage = $this->_getOwnerObjectOfPage( $sPageSlug ) ) |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $GLOBALS, |
229 | 229 | array( 'aAdminPageFramework', 'aPageClasses' ) |
230 | 230 | ); |
231 | - foreach( $_aPageClasses as $_oAdminPage ) { |
|
231 | + foreach ( $_aPageClasses as $_oAdminPage ) { |
|
232 | 232 | if ( $_oAdminPage->oProp->isPageAdded( $sPageSlug ) ) { |
233 | 233 | return $_oAdminPage; |
234 | 234 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | /** |
58 | 58 | * Sets up hooks and properties. |
59 | 59 | */ |
60 | - public function __construct( $oCaller, $sClassName, $sCapability='manage_options', $sTextDomain='admin-page-framework', $sStructureType='page_meta_box' ) { |
|
60 | + public function __construct( $oCaller, $sClassName, $sCapability='manage_options', $sTextDomain='admin-page-framework', $sStructureType='page_meta_box' ) { |
|
61 | 61 | |
62 | 62 | // Let them overload. |
63 | 63 | unset( |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @since 3.0.0 |
117 | 117 | * @return boolean Returns true if it is of framework's added page; otherwise, false. |
118 | 118 | */ |
119 | - public function isPageAdded( $sPageSlug='' ) { |
|
119 | + public function isPageAdded( $sPageSlug='' ) { |
|
120 | 120 | $_oAdminPage = $this->_getOwnerObjectOfPage( $sPageSlug ); |
121 | 121 | return $_oAdminPage |
122 | 122 | ? $_oAdminPage->oProp->isPageAdded( $sPageSlug ) |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | public function isCurrentTab( $sTabSlug ) { |
134 | 134 | |
135 | 135 | $_sCurrentPageSlug = $this->getElement( $_GET, 'page' ); |
136 | - if ( ! $_sCurrentPageSlug ) { |
|
136 | + if ( ! $_sCurrentPageSlug ) { |
|
137 | 137 | return false; |
138 | 138 | } |
139 | 139 | $_sCurrentTabSlug = $this->getElement( |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | */ |
187 | 187 | public function getDefaultInPageTab( $sPageSlug ) { |
188 | 188 | |
189 | - if ( ! $sPageSlug ) { |
|
189 | + if ( ! $sPageSlug ) { |
|
190 | 190 | return ''; |
191 | 191 | } |
192 | 192 | return ( $_oAdminPage = $this->_getOwnerObjectOfPage( $sPageSlug ) ) |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function getOptionKey( $sPageSlug ) { |
203 | 203 | |
204 | - if ( ! $sPageSlug ) { |
|
204 | + if ( ! $sPageSlug ) { |
|
205 | 205 | return ''; |
206 | 206 | } |
207 | 207 | return ( $_oAdminPage = $this->_getOwnerObjectOfPage( $sPageSlug ) ) |
@@ -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,9 +58,9 @@ 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 | - $sSRC = trim( $sSRC ); |
|
63 | + $sSRC = trim( $sSRC ); |
|
64 | 64 | if ( empty( $sSRC ) ) { |
65 | 65 | return ''; |
66 | 66 | } |
@@ -77,13 +77,13 @@ discard block |
||
77 | 77 | array( |
78 | 78 | 'sSRC' => $sSRC, |
79 | 79 | 'sType' => 'style', |
80 | - 'handle_id' => 'style_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedStyleIndex ), |
|
80 | + 'handle_id' => 'style_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedStyleIndex ), |
|
81 | 81 | ), |
82 | 82 | self::$_aStructure_EnqueuingResources |
83 | 83 | ); |
84 | 84 | |
85 | 85 | // Store the attributes in another container by url. |
86 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['attributes']; |
|
86 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'attributes' ]; |
|
87 | 87 | |
88 | 88 | return $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ]; |
89 | 89 | |
@@ -95,11 +95,11 @@ discard block |
||
95 | 95 | * @since 3.0.0 |
96 | 96 | * @remark the $_deprecated parameter is just to avoid the PHP strict standards warning. |
97 | 97 | */ |
98 | - public function _enqueueScripts( $aSRCs, $aCustomArgs=array(), $_deprecated=null ) { |
|
98 | + public function _enqueueScripts( $aSRCs, $aCustomArgs = array(), $_deprecated = null ) { |
|
99 | 99 | |
100 | 100 | $_aHandleIDs = array(); |
101 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
102 | - $_aHandleIDs[] = $this->_enqueueScript( $_sSRC, $aCustomArgs ); |
|
101 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
102 | + $_aHandleIDs[ ] = $this->_enqueueScript( $_sSRC, $aCustomArgs ); |
|
103 | 103 | } |
104 | 104 | return $_aHandleIDs; |
105 | 105 | |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
125 | 125 | * @internal |
126 | 126 | */ |
127 | - public function _enqueueScript( $sSRC, $aCustomArgs=array(), $_deprecated=null ) { |
|
127 | + public function _enqueueScript( $sSRC, $aCustomArgs = array(), $_deprecated = null ) { |
|
128 | 128 | |
129 | - $sSRC = trim( $sSRC ); |
|
129 | + $sSRC = trim( $sSRC ); |
|
130 | 130 | if ( empty( $sSRC ) ) { |
131 | 131 | return ''; |
132 | 132 | } |
@@ -143,13 +143,13 @@ discard block |
||
143 | 143 | array( |
144 | 144 | 'sSRC' => $sSRC, |
145 | 145 | 'sType' => 'script', |
146 | - 'handle_id' => 'script_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedScriptIndex ), |
|
146 | + 'handle_id' => 'script_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedScriptIndex ), |
|
147 | 147 | ), |
148 | 148 | self::$_aStructure_EnqueuingResources |
149 | 149 | ); |
150 | 150 | |
151 | 151 | // Store the attributes in another container by url. |
152 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['attributes']; |
|
152 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'attributes' ]; |
|
153 | 153 | |
154 | 154 | return $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ]; |
155 | 155 | |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | * @since 3.0.0 |
162 | 162 | * @internal |
163 | 163 | */ |
164 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
164 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
165 | 165 | return $this->_enqueueStyle( $sSRC, $aCustomArgs ); |
166 | 166 | } |
167 | 167 | /** |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * @since 3.0.0 |
171 | 171 | * @internal |
172 | 172 | */ |
173 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
173 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
174 | 174 | return $this->_enqueueScript( $sSRC, $aCustomArgs ); |
175 | 175 | } |
176 | 176 |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | public function _enqueueStyle( $sSRC, $aCustomArgs=array(), $_deprecated=null ) { |
62 | 62 | |
63 | 63 | $sSRC = trim( $sSRC ); |
64 | - if ( empty( $sSRC ) ) { |
|
64 | + if ( empty( $sSRC ) ) { |
|
65 | 65 | return ''; |
66 | 66 | } |
67 | 67 | $sSRC = $this->oUtil->getResolvedSRC( $sSRC ); |
@@ -127,14 +127,14 @@ discard block |
||
127 | 127 | public function _enqueueScript( $sSRC, $aCustomArgs=array(), $_deprecated=null ) { |
128 | 128 | |
129 | 129 | $sSRC = trim( $sSRC ); |
130 | - if ( empty( $sSRC ) ) { |
|
130 | + if ( empty( $sSRC ) ) { |
|
131 | 131 | return ''; |
132 | 132 | } |
133 | 133 | $sSRC = $this->oUtil->getResolvedSRC( $sSRC ); |
134 | 134 | |
135 | 135 | // Setting the key based on the url prevents duplicate items |
136 | 136 | $_sSRCHash = md5( $sSRC ); |
137 | - if ( isset( $this->oProp->aEnqueuingScripts[ $_sSRCHash ] ) ) { |
|
137 | + if ( isset( $this->oProp->aEnqueuingScripts[ $_sSRCHash ] ) ) { |
|
138 | 138 | return ''; |
139 | 139 | } |
140 | 140 |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | * @since 3.2.0 |
30 | 30 | * @internal |
31 | 31 | */ |
32 | - public function _enqueueStyles( $aSRCs, $aCustomArgs=array() ) { |
|
32 | + public function _enqueueStyles( $aSRCs, $aCustomArgs = array() ) { |
|
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 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
49 | 49 | * @internal |
50 | 50 | */ |
51 | - public function _enqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
51 | + public function _enqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
52 | 52 | |
53 | 53 | $sSRC = trim( $sSRC ); |
54 | 54 | if ( empty( $sSRC ) ) { |
@@ -67,13 +67,13 @@ discard block |
||
67 | 67 | array( |
68 | 68 | 'sSRC' => $sSRC, |
69 | 69 | 'sType' => 'style', |
70 | - 'handle_id' => 'style_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedStyleIndex ), |
|
70 | + 'handle_id' => 'style_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedStyleIndex ), |
|
71 | 71 | ), |
72 | 72 | self::$_aStructure_EnqueuingResources |
73 | 73 | ); |
74 | 74 | |
75 | 75 | // Store the attributes in another container by url. |
76 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['attributes']; |
|
76 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'attributes' ]; |
|
77 | 77 | |
78 | 78 | return $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ]; |
79 | 79 | |
@@ -85,11 +85,11 @@ discard block |
||
85 | 85 | * @since 3.2.0 |
86 | 86 | * @internal |
87 | 87 | */ |
88 | - public function _enqueueScripts( $aSRCs, $aCustomArgs=array() ) { |
|
88 | + public function _enqueueScripts( $aSRCs, $aCustomArgs = array() ) { |
|
89 | 89 | |
90 | 90 | $_aHandleIDs = array(); |
91 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
92 | - $_aHandleIDs[] = $this->_enqueueScript( $_sSRC, $aCustomArgs ); |
|
91 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
92 | + $_aHandleIDs[ ] = $this->_enqueueScript( $_sSRC, $aCustomArgs ); |
|
93 | 93 | } |
94 | 94 | return $_aHandleIDs; |
95 | 95 | |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
105 | 105 | * @internal |
106 | 106 | */ |
107 | - public function _enqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
107 | + public function _enqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
108 | 108 | |
109 | 109 | $sSRC = trim( $sSRC ); |
110 | 110 | if ( empty( $sSRC ) ) { return ''; } |
@@ -119,13 +119,13 @@ discard block |
||
119 | 119 | array( |
120 | 120 | 'sSRC' => $sSRC, |
121 | 121 | 'sType' => 'script', |
122 | - 'handle_id' => 'script_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedScriptIndex ), |
|
122 | + 'handle_id' => 'script_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedScriptIndex ), |
|
123 | 123 | ), |
124 | 124 | self::$_aStructure_EnqueuingResources |
125 | 125 | ); |
126 | 126 | |
127 | 127 | // Store the attributes in another container by url. |
128 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['attributes']; |
|
128 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'attributes' ]; |
|
129 | 129 | |
130 | 130 | return $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ]; |
131 | 131 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | * @since 3.2.0 |
140 | 140 | * @internal |
141 | 141 | */ |
142 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
142 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
143 | 143 | return $this->_enqueueStyle( $sSRC, $aCustomArgs ); |
144 | 144 | } |
145 | 145 | /** |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * @since 3.2.0 |
150 | 150 | * @internal |
151 | 151 | */ |
152 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
152 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
153 | 153 | return $this->_enqueueScript( $sSRC, $aCustomArgs ); |
154 | 154 | } |
155 | 155 |
@@ -51,14 +51,14 @@ discard block |
||
51 | 51 | public function _enqueueStyle( $sSRC, $aCustomArgs=array() ) { |
52 | 52 | |
53 | 53 | $sSRC = trim( $sSRC ); |
54 | - if ( empty( $sSRC ) ) { |
|
54 | + if ( empty( $sSRC ) ) { |
|
55 | 55 | return ''; |
56 | 56 | } |
57 | 57 | $sSRC = $this->getResolvedSRC( $sSRC ); |
58 | 58 | |
59 | 59 | // Setting the key based on the url prevents duplicate items |
60 | 60 | $_sSRCHash = md5( $sSRC ); |
61 | - if ( isset( $this->oProp->aEnqueuingStyles[ $_sSRCHash ] ) ) { |
|
61 | + if ( isset( $this->oProp->aEnqueuingStyles[ $_sSRCHash ] ) ) { |
|
62 | 62 | return ''; |
63 | 63 | } |
64 | 64 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | |
113 | 113 | // Setting the key based on the url prevents duplicate items |
114 | 114 | $_sSRCHash = md5( $sSRC ); |
115 | - if ( isset( $this->oProp->aEnqueuingScripts[ $_sSRCHash ] ) ) { |
|
115 | + if ( isset( $this->oProp->aEnqueuingScripts[ $_sSRCHash ] ) ) { |
|
116 | 116 | return ''; |
117 | 117 | } |
118 | 118 |
@@ -111,13 +111,13 @@ |
||
111 | 111 | * Sets up properties. |
112 | 112 | * @since 3.7.0 |
113 | 113 | */ |
114 | - public function __construct( $oCaller, $sCallerPath, $sClassName, $sCapability='manage_options', $sTextDomain='admin-page-framework', $sStructureType ) { |
|
114 | + public function __construct( $oCaller, $sCallerPath, $sClassName, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework', $sStructureType ) { |
|
115 | 115 | |
116 | 116 | // 3.7.0+ |
117 | - $this->_sFormRegistrationHook = 'load_' . $sClassName; |
|
117 | + $this->_sFormRegistrationHook = 'load_'.$sClassName; |
|
118 | 118 | |
119 | 119 | // 3.7.9+ - setting a custom action hook for admin notices prevents the form object from being instantiated unnecessarily. |
120 | - $this->sSettingNoticeActionHook = 'load_' . $sClassName; |
|
120 | + $this->sSettingNoticeActionHook = 'load_'.$sClassName; |
|
121 | 121 | |
122 | 122 | parent::__construct( |
123 | 123 | $oCaller, |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | if ( $this->oProp->bIsAdmin ) { |
34 | 34 | |
35 | - add_action( 'load_' . $this->oProp->sPostType, array( $this, '_replyToSetUpHooksForView' ) ); |
|
35 | + add_action( 'load_'.$this->oProp->sPostType, array( $this, '_replyToSetUpHooksForView' ) ); |
|
36 | 36 | |
37 | 37 | // 3.5.10+ |
38 | 38 | add_action( 'admin_menu', array( $this, '_replyToRemoveAddNewSidebarMenu' ) ); |
@@ -106,19 +106,19 @@ discard block |
||
106 | 106 | private function _removeAddNewSidebarSubMenu( $sMenuKey, $sPostTypeSlug ) { |
107 | 107 | |
108 | 108 | // Remove the default post type menu item. |
109 | - if ( ! isset( $GLOBALS[ 'submenu' ][ $sMenuKey ] ) ) { |
|
109 | + if ( !isset( $GLOBALS[ 'submenu' ][ $sMenuKey ] ) ) { |
|
110 | 110 | // logged-in users of an insufficient access level don't have the menu to be registered. |
111 | 111 | return; |
112 | 112 | } |
113 | 113 | |
114 | 114 | foreach ( $GLOBALS[ 'submenu' ][ $sMenuKey ] as $_iIndex => $_aSubMenu ) { |
115 | 115 | |
116 | - if ( ! isset( $_aSubMenu[ 2 ] ) ) { |
|
116 | + if ( !isset( $_aSubMenu[ 2 ] ) ) { |
|
117 | 117 | continue; |
118 | 118 | } |
119 | 119 | |
120 | 120 | // Remove the default Add New entry. |
121 | - if ( 'post-new.php?post_type=' . $sPostTypeSlug === $_aSubMenu[ 2 ] ) { |
|
121 | + if ( 'post-new.php?post_type='.$sPostTypeSlug === $_aSubMenu[ 2 ] ) { |
|
122 | 122 | unset( $GLOBALS[ 'submenu' ][ $sMenuKey ][ $_iIndex ] ); |
123 | 123 | break; |
124 | 124 | } |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function _replyToModifyActionLinks( $aActionLinks, $oPost ) { |
137 | 137 | |
138 | - if ( $oPost->post_type !== $this->oProp->sPostType ){ |
|
138 | + if ( $oPost->post_type !== $this->oProp->sPostType ) { |
|
139 | 139 | return $aActionLinks; |
140 | 140 | } |
141 | 141 | |
@@ -157,12 +157,12 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function _replyToAddAuthorTableFilter() { |
159 | 159 | |
160 | - if ( ! $this->oProp->bEnableAuthorTableFileter ) { |
|
160 | + if ( !$this->oProp->bEnableAuthorTableFileter ) { |
|
161 | 161 | return; |
162 | 162 | } |
163 | 163 | |
164 | 164 | if ( |
165 | - ! ( isset( $_GET[ 'post_type' ] ) && post_type_exists( $_GET[ 'post_type' ] ) |
|
165 | + !( isset( $_GET[ 'post_type' ] ) && post_type_exists( $_GET[ 'post_type' ] ) |
|
166 | 166 | && in_array( strtolower( $_GET[ 'post_type' ] ), array( $this->oProp->sPostType ) ) ) |
167 | 167 | ) { |
168 | 168 | return; |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | foreach ( get_object_taxonomies( $GLOBALS[ 'typenow' ] ) as $_sTaxonomySulg ) { |
204 | 204 | |
205 | - if ( ! in_array( $_sTaxonomySulg, $this->oProp->aTaxonomyTableFilters ) ) { |
|
205 | + if ( !in_array( $_sTaxonomySulg, $this->oProp->aTaxonomyTableFilters ) ) { |
|
206 | 206 | continue; |
207 | 207 | } |
208 | 208 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | // Echo the drop down list based on the passed array argument. |
217 | 217 | wp_dropdown_categories( |
218 | 218 | array( |
219 | - 'show_option_all' => $this->oMsg->get( 'show_all' ) . ' ' . $_oTaxonomy->label, |
|
219 | + 'show_option_all' => $this->oMsg->get( 'show_all' ).' '.$_oTaxonomy->label, |
|
220 | 220 | 'taxonomy' => $_sTaxonomySulg, |
221 | 221 | 'name' => $_oTaxonomy->name, |
222 | 222 | 'orderby' => 'name', |
@@ -236,24 +236,24 @@ discard block |
||
236 | 236 | * |
237 | 237 | * @internal |
238 | 238 | */ |
239 | - public function _replyToGetTableFilterQueryForTaxonomies( $oQuery=null ) { |
|
239 | + public function _replyToGetTableFilterQueryForTaxonomies( $oQuery = null ) { |
|
240 | 240 | |
241 | 241 | if ( 'edit.php' != $this->oProp->sPageNow ) { |
242 | 242 | return $oQuery; |
243 | 243 | } |
244 | 244 | |
245 | - if ( ! isset( $GLOBALS[ 'typenow' ] ) ) { |
|
245 | + if ( !isset( $GLOBALS[ 'typenow' ] ) ) { |
|
246 | 246 | return $oQuery; |
247 | 247 | } |
248 | 248 | |
249 | 249 | foreach ( get_object_taxonomies( $GLOBALS[ 'typenow' ] ) as $sTaxonomySlug ) { |
250 | 250 | |
251 | - if ( ! in_array( $sTaxonomySlug, $this->oProp->aTaxonomyTableFilters ) ) { |
|
251 | + if ( !in_array( $sTaxonomySlug, $this->oProp->aTaxonomyTableFilters ) ) { |
|
252 | 252 | continue; |
253 | 253 | } |
254 | 254 | |
255 | 255 | $sVar = &$oQuery->query_vars[ $sTaxonomySlug ]; |
256 | - if ( ! isset( $sVar ) ) { |
|
256 | + if ( !isset( $sVar ) ) { |
|
257 | 257 | continue; |
258 | 258 | } |
259 | 259 | |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | $this->oProp->sStyle = $this->oUtil->addAndApplyFilters( $this, "style_{$this->oProp->sClassName}", $this->oProp->sStyle ); |
290 | 290 | |
291 | 291 | // Print out the filtered styles. |
292 | - if ( ! empty( $this->oProp->sStyle ) ) { |
|
292 | + if ( !empty( $this->oProp->sStyle ) ) { |
|
293 | 293 | echo "<style type='text/css' id='admin-page-framework-style-post-type'>" |
294 | 294 | . $this->oProp->sStyle |
295 | 295 | . "</style>"; |
@@ -344,10 +344,10 @@ discard block |
||
344 | 344 | */ |
345 | 345 | public function _replyToFilterPostTypeContent( $sContent ) { |
346 | 346 | |
347 | - if ( ! is_singular() ) { |
|
347 | + if ( !is_singular() ) { |
|
348 | 348 | return $sContent; |
349 | 349 | } |
350 | - if ( ! is_main_query() ) { |
|
350 | + if ( !is_main_query() ) { |
|
351 | 351 | return $sContent; |
352 | 352 | } |
353 | 353 | global $post; |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * @package AdminPageFramework/Factory/PostType |
18 | 18 | * @extends AdminPageFramework_PostType_Model |
19 | 19 | */ |
20 | -abstract class AdminPageFramework_PostType_View extends AdminPageFramework_PostType_Model { |
|
20 | +abstract class AdminPageFramework_PostType_View extends AdminPageFramework_PostType_Model { |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Sets up hooks. |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @callback action load_{post type slug} |
49 | 49 | * @since 3.7.9 |
50 | 50 | */ |
51 | - public function _replyToSetUpHooksForView() { |
|
51 | + public function _replyToSetUpHooksForView() { |
|
52 | 52 | |
53 | 53 | // Table filters |
54 | 54 | add_action( 'restrict_manage_posts', array( $this, '_replyToAddAuthorTableFilter' ) ); |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | |
113 | 113 | foreach ( $GLOBALS[ 'submenu' ][ $sMenuKey ] as $_iIndex => $_aSubMenu ) { |
114 | 114 | |
115 | - if ( ! isset( $_aSubMenu[ 2 ] ) ) { |
|
115 | + if ( ! isset( $_aSubMenu[ 2 ] ) ) { |
|
116 | 116 | continue; |
117 | 117 | } |
118 | 118 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function _replyToModifyActionLinks( $aActionLinks, $oPost ) { |
136 | 136 | |
137 | - if ( $oPost->post_type !== $this->oProp->sPostType ){ |
|
137 | + if ( $oPost->post_type !== $this->oProp->sPostType ) { |
|
138 | 138 | return $aActionLinks; |
139 | 139 | } |
140 | 140 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | public function _replyToAddAuthorTableFilter() { |
158 | 158 | |
159 | - if ( ! $this->oProp->bEnableAuthorTableFileter ) { |
|
159 | + if ( ! $this->oProp->bEnableAuthorTableFileter ) { |
|
160 | 160 | return; |
161 | 161 | } |
162 | 162 | |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | */ |
190 | 190 | public function _replyToAddTaxonomyTableFilter() { |
191 | 191 | |
192 | - if ( $GLOBALS[ 'typenow' ] != $this->oProp->sPostType ) { |
|
192 | + if ( $GLOBALS[ 'typenow' ] != $this->oProp->sPostType ) { |
|
193 | 193 | return; |
194 | 194 | } |
195 | 195 | |
@@ -237,22 +237,22 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function _replyToGetTableFilterQueryForTaxonomies( $oQuery=null ) { |
239 | 239 | |
240 | - if ( 'edit.php' != $this->oProp->sPageNow ) { |
|
240 | + if ( 'edit.php' != $this->oProp->sPageNow ) { |
|
241 | 241 | return $oQuery; |
242 | 242 | } |
243 | 243 | |
244 | - if ( ! isset( $GLOBALS[ 'typenow' ] ) ) { |
|
244 | + if ( ! isset( $GLOBALS[ 'typenow' ] ) ) { |
|
245 | 245 | return $oQuery; |
246 | 246 | } |
247 | 247 | |
248 | 248 | foreach ( get_object_taxonomies( $GLOBALS[ 'typenow' ] ) as $sTaxonomySlug ) { |
249 | 249 | |
250 | - if ( ! in_array( $sTaxonomySlug, $this->oProp->aTaxonomyTableFilters ) ) { |
|
250 | + if ( ! in_array( $sTaxonomySlug, $this->oProp->aTaxonomyTableFilters ) ) { |
|
251 | 251 | continue; |
252 | 252 | } |
253 | 253 | |
254 | 254 | $sVar = &$oQuery->query_vars[ $sTaxonomySlug ]; |
255 | - if ( ! isset( $sVar ) ) { |
|
255 | + if ( ! isset( $sVar ) ) { |
|
256 | 256 | continue; |
257 | 257 | } |
258 | 258 | |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | * @remark This class should be overridden in the extended class. |
330 | 330 | * @since 3.1.5 |
331 | 331 | */ |
332 | - public function content( $sContent ) { |
|
332 | + public function content( $sContent ) { |
|
333 | 333 | return $sContent; |
334 | 334 | } |
335 | 335 |
@@ -33,7 +33,7 @@ |
||
33 | 33 | array( $this, '_replyToAddPostTypeQueryInEditPostLink' ), |
34 | 34 | 10, |
35 | 35 | 3 |
36 | - ); |
|
36 | + ); |
|
37 | 37 | } |
38 | 38 | } |
39 | 39 |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | * Sets up hooks and properties. |
22 | 22 | * |
23 | 23 | */ |
24 | - public function __construct( $oProp, $oMsg=null ) { |
|
24 | + public function __construct( $oProp, $oMsg = null ) { |
|
25 | 25 | |
26 | 26 | parent::__construct( $oProp, $oMsg ); |
27 | 27 | |
28 | 28 | // For post type posts listing table page ( edit.php ) |
29 | - if ( isset( $_GET['post_type'] ) && $_GET['post_type'] == $this->oProp->sPostType ) { |
|
29 | + if ( isset( $_GET[ 'post_type' ] ) && $_GET[ 'post_type' ] == $this->oProp->sPostType ) { |
|
30 | 30 | add_action( |
31 | 31 | 'get_edit_post_link', |
32 | 32 | array( $this, '_replyToAddPostTypeQueryInEditPostLink' ), |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | ); |
60 | 60 | |
61 | 61 | // If the user explicitly sets an empty string to the label key, do not insert a link. |
62 | - if ( ! $_sLinkLabel ) { |
|
62 | + if ( !$_sLinkLabel ) { |
|
63 | 63 | return $aLinks; |
64 | 64 | } |
65 | 65 | |
@@ -67,13 +67,13 @@ discard block |
||
67 | 67 | array_unshift( |
68 | 68 | $aLinks, |
69 | 69 | // "<a href='" . esc_url( "edit.php?post_type={$this->oProp->sPostType}" ) . "'>" |
70 | - '<a ' . $this->getAttributes( |
|
70 | + '<a '.$this->getAttributes( |
|
71 | 71 | array( |
72 | 72 | 'href' => esc_url( "edit.php?post_type={$this->oProp->sPostType}" ), |
73 | 73 | // 3.5.7+ Added for acceptance testing |
74 | 74 | 'class' => 'apf-plugin-title-action-link apf-admin-page', |
75 | 75 | ) |
76 | - ) . '>' |
|
76 | + ).'>' |
|
77 | 77 | . $_sLinkLabel |
78 | 78 | . "</a>" |
79 | 79 | ); |
@@ -89,9 +89,9 @@ discard block |
||
89 | 89 | public function _replyToSetFooterInfo() { |
90 | 90 | |
91 | 91 | if ( |
92 | - ! $this->isPostDefinitionPage( $this->oProp->sPostType ) |
|
93 | - && ! $this->isPostListingPage( $this->oProp->sPostType ) |
|
94 | - && ! $this->isCustomTaxonomyPage( $this->oProp->sPostType ) |
|
92 | + !$this->isPostDefinitionPage( $this->oProp->sPostType ) |
|
93 | + && !$this->isPostListingPage( $this->oProp->sPostType ) |
|
94 | + && !$this->isCustomTaxonomyPage( $this->oProp->sPostType ) |
|
95 | 95 | ) { |
96 | 96 | return; |
97 | 97 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | * @remark e.g. `http://.../wp-admin/post.php?post=180&action=edit` -> `http://.../wp-admin/post.php?post=180&action=edit&post_type=[...]` |
110 | 110 | * @callback filter get_edit_post_link |
111 | 111 | */ |
112 | - public function _replyToAddPostTypeQueryInEditPostLink( $sURL, $iPostID=null, $sContext=null ) { |
|
112 | + public function _replyToAddPostTypeQueryInEditPostLink( $sURL, $iPostID = null, $sContext = null ) { |
|
113 | 113 | return add_query_arg( |
114 | 114 | array( |
115 | 115 | 'post' => $iPostID, |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | |
39 | 39 | if ( $this->oProp->bIsAdmin ) { |
40 | 40 | |
41 | - add_action( 'load_' . $this->oProp->sPostType, array( $this, '_replyToSetUpHooksForModel' ) ); |
|
41 | + add_action( 'load_'.$this->oProp->sPostType, array( $this, '_replyToSetUpHooksForModel' ) ); |
|
42 | 42 | |
43 | 43 | if ( $this->oProp->sCallerPath ) { |
44 | 44 | new AdminPageFramework_PostType_Model__FlushRewriteRules( $this ); |
@@ -65,11 +65,11 @@ discard block |
||
65 | 65 | |
66 | 66 | // Properties - sets translatable labels. |
67 | 67 | $this->oProp->aColumnHeaders = array( |
68 | - 'cb' => '<input type="checkbox" />', // Checkbox for bulk actions. |
|
69 | - 'title' => $this->oMsg->get( 'title' ), // Post title. Includes "edit", "quick edit", "trash" and "view" links. If $mode (set from $_REQUEST['mode']) is 'excerpt', a post excerpt is included between the title and links. |
|
70 | - 'author' => $this->oMsg->get( 'author' ), // Post author. |
|
68 | + 'cb' => '<input type="checkbox" />', // Checkbox for bulk actions. |
|
69 | + 'title' => $this->oMsg->get( 'title' ), // Post title. Includes "edit", "quick edit", "trash" and "view" links. If $mode (set from $_REQUEST['mode']) is 'excerpt', a post excerpt is included between the title and links. |
|
70 | + 'author' => $this->oMsg->get( 'author' ), // Post author. |
|
71 | 71 | 'comments' => '<div class="comment-grey-bubble"></div>', // Number of pending comments. |
72 | - 'date' => $this->oMsg->get( 'date' ), // The date and publish status of the post. |
|
72 | + 'date' => $this->oMsg->get( 'date' ), // The date and publish status of the post. |
|
73 | 73 | ); |
74 | 74 | |
75 | 75 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | echo $this->oUtil->addAndApplyFilter( |
132 | 132 | $this, |
133 | 133 | "cell_{$this->oProp->sPostType}_{$sColumnKey}", |
134 | - '', // value to be filtered - cell output |
|
134 | + '', // value to be filtered - cell output |
|
135 | 135 | $iPostID |
136 | 136 | ); |
137 | 137 | } |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | * @internal |
181 | 181 | */ |
182 | 182 | public function _replyToRegisterTaxonomies() { |
183 | - foreach( $this->oProp->aTaxonomies as $_sTaxonomySlug => $_aArguments ) { |
|
183 | + foreach ( $this->oProp->aTaxonomies as $_sTaxonomySlug => $_aArguments ) { |
|
184 | 184 | $this->_registerTaxonomy( |
185 | 185 | $_sTaxonomySlug, |
186 | 186 | $this->oUtil->getAsArray( $this->oProp->aTaxonomyObjectTypes[ $_sTaxonomySlug ] ), // object types |
@@ -196,8 +196,8 @@ discard block |
||
196 | 196 | */ |
197 | 197 | public function _registerTaxonomy( $sTaxonomySlug, array $aObjectTypes, array $aArguments ) { |
198 | 198 | |
199 | - if ( ! in_array( $this->oProp->sPostType, $aObjectTypes ) ) { |
|
200 | - $aObjectTypes[] = $this->oProp->sPostType; |
|
199 | + if ( !in_array( $this->oProp->sPostType, $aObjectTypes ) ) { |
|
200 | + $aObjectTypes[ ] = $this->oProp->sPostType; |
|
201 | 201 | } |
202 | 202 | register_taxonomy( |
203 | 203 | $sTaxonomySlug, |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | */ |
236 | 236 | public function _replyToRemoveTexonomySubmenuPages() { |
237 | 237 | |
238 | - foreach( $this->oProp->aTaxonomyRemoveSubmenuPages as $sSubmenuPageSlug => $sTopLevelPageSlug ) { |
|
238 | + foreach ( $this->oProp->aTaxonomyRemoveSubmenuPages as $sSubmenuPageSlug => $sTopLevelPageSlug ) { |
|
239 | 239 | |
240 | 240 | remove_submenu_page( $sTopLevelPageSlug, $sSubmenuPageSlug ); |
241 | 241 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * @package AdminPageFramework/Factory/PostType |
18 | 18 | * @internal |
19 | 19 | */ |
20 | -abstract class AdminPageFramework_PostType_Model extends AdminPageFramework_PostType_Router { |
|
20 | +abstract class AdminPageFramework_PostType_Model extends AdminPageFramework_PostType_Router { |
|
21 | 21 | |
22 | 22 | /** |
23 | 23 | * Sets up hooks and properties. |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | * @callback action manage_{post type slug}_posts_custom_column |
127 | 127 | * @return string |
128 | 128 | */ |
129 | - public function _replyToPrintColumnCell( $sColumnKey, $iPostID ) { |
|
129 | + public function _replyToPrintColumnCell( $sColumnKey, $iPostID ) { |
|
130 | 130 | echo $this->oUtil->addAndApplyFilter( |
131 | 131 | $this, |
132 | 132 | "cell_{$this->oProp->sPostType}_{$sColumnKey}", |
@@ -144,10 +144,10 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public function _replyToDisableAutoSave() { |
146 | 146 | |
147 | - if ( $this->oProp->bEnableAutoSave ) { |
|
147 | + if ( $this->oProp->bEnableAutoSave ) { |
|
148 | 148 | return; |
149 | 149 | } |
150 | - if ( $this->oProp->sPostType != get_post_type() ) { |
|
150 | + if ( $this->oProp->sPostType != get_post_type() ) { |
|
151 | 151 | return; |
152 | 152 | } |
153 | 153 | wp_dequeue_script( 'autosave' ); |
@@ -74,7 +74,7 @@ |
||
74 | 74 | 'title' => 'Title', // Post title. Includes "edit", "quick edit", "trash" and "view" links. If $mode (set from $_REQUEST['mode']) is 'excerpt', a post excerpt is included between the title and links. |
75 | 75 | 'author' => 'Author', // Post author. |
76 | 76 | 'comments' => '<div class="comment-grey-bubble"></div>', // Number of pending comments. |
77 | - 'date' => 'Date', // The date and publish status of the post. |
|
77 | + 'date' => 'Date', // The date and publish status of the post. |
|
78 | 78 | ); |
79 | 79 | |
80 | 80 | /** |