@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * Converts non-alphabetic characters to underscore. |
37 | 37 | * |
38 | 38 | * @since 2.0.0 |
39 | - * @return string|null The sanitized string. |
|
39 | + * @return string The sanitized string. |
|
40 | 40 | * @todo Change the method name as it does not tell for what it will sanitized. |
41 | 41 | * @todo Examine why null needs to be returned. |
42 | 42 | */ |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | /** |
120 | 120 | * Returns the given string length. |
121 | 121 | * @since 3.3.0 |
122 | - * @return integer|null Null if an array is given. |
|
122 | + * @return integer Null if an array is given. |
|
123 | 123 | */ |
124 | 124 | static public function getStringLength( $sString ) { |
125 | 125 | return function_exists( 'mb_strlen' ) |
@@ -176,6 +176,8 @@ discard block |
||
176 | 176 | } |
177 | 177 | /** |
178 | 178 | * Trims a traling sub-string if exists. |
179 | + * @param string $sString |
|
180 | + * @param string $sSuffix |
|
179 | 181 | * @return string |
180 | 182 | * @since 3.7.2 |
181 | 183 | */ |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | * @since 3.1.1 |
27 | 27 | * @return string |
28 | 28 | */ |
29 | - static public function sanitizeLength( $sLength, $sUnit='px' ) { |
|
29 | + static public function sanitizeLength( $sLength, $sUnit = 'px' ) { |
|
30 | 30 | return is_numeric( $sLength ) |
31 | - ? $sLength . $sUnit |
|
31 | + ? $sLength.$sUnit |
|
32 | 32 | : $sLength; |
33 | 33 | } |
34 | 34 | |
@@ -71,9 +71,9 @@ discard block |
||
71 | 71 | * @since 2.0.0 |
72 | 72 | * @return string|integer A numeric value will be returned. |
73 | 73 | */ |
74 | - static public function fixNumber( $nToFix, $nDefault, $nMin='', $nMax='' ) { |
|
74 | + static public function fixNumber( $nToFix, $nDefault, $nMin = '', $nMax = '' ) { |
|
75 | 75 | |
76 | - if ( ! is_numeric( trim( $nToFix ) ) ) { |
|
76 | + if ( !is_numeric( trim( $nToFix ) ) ) { |
|
77 | 77 | return $nDefault; |
78 | 78 | } |
79 | 79 | if ( $nMin !== '' && $nToFix < $nMin ) { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | static public function getCSSMinified( $sCSSRules ) { |
98 | 98 | return str_replace( |
99 | - array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' '), // remove line breaks, tab, and white sspaces. |
|
99 | + array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' ' ), // remove line breaks, tab, and white sspaces. |
|
100 | 100 | '', |
101 | 101 | preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $sCSSRules ) // remove comments |
102 | 102 | ); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | static public function minifyCSS( $sCSSRules ) { |
108 | 108 | trigger_error( |
109 | - AdminPageFramework_Registry::NAME . ': ' . sprintf( |
|
109 | + AdminPageFramework_Registry::NAME.': '.sprintf( |
|
110 | 110 | 'The method, %1$s, is deprecated. Use %2$s instead.', |
111 | 111 | 'minifyCSS()', |
112 | 112 | 'getCSSMinified()' |
@@ -136,8 +136,8 @@ discard block |
||
136 | 136 | */ |
137 | 137 | static public function getNumberOfReadableSize( $nSize ) { |
138 | 138 | |
139 | - $_nReturn = substr( $nSize, 0, -1 ); |
|
140 | - switch( strtoupper( substr( $nSize, -1 ) ) ) { |
|
139 | + $_nReturn = substr( $nSize, 0, -1 ); |
|
140 | + switch ( strtoupper( substr( $nSize, -1 ) ) ) { |
|
141 | 141 | case 'P': |
142 | 142 | $_nReturn *= 1024; |
143 | 143 | case 'T': |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | $_iPower = ( int ) $_nLog; |
166 | 166 | $_iSize = pow( 1024, $_nLog - $_iPower ); |
167 | 167 | |
168 | - return $_iSize . $_aUnits[ $_iPower ]; |
|
168 | + return $_iSize.$_aUnits[ $_iPower ]; |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -95,7 +95,7 @@ |
||
95 | 95 | * Returns an array of constants. |
96 | 96 | * |
97 | 97 | * @since 3.4.6 |
98 | - * @param array|string $asCategory The category key names of the returning array. |
|
98 | + * @param array|string $asCategories The category key names of the returning array. |
|
99 | 99 | */ |
100 | 100 | static public function getDefinedConstants( $asCategories=null, $asRemovingCategories=null ) { |
101 | 101 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $_sOutput = preg_replace( |
42 | 42 | array( |
43 | 43 | '#^.*<body>(.*)</body>.*$#ms', '#<h2>PHP License</h2>.*$#ms', |
44 | - '#<h1>Configuration</h1>#', "#\r?\n#", "#</(h1|h2|h3|tr)>#", '# +<#', |
|
44 | + '#<h1>Configuration</h1>#', "#\r?\n#", "#</(h1|h2|h3|tr)>#", '# +<#', |
|
45 | 45 | "#[ \t]+#", '# #', '# +#', '# class=".*?"#', '%'%', |
46 | 46 | '#<tr>(?:.*?)" src="(?:.*?)=(.*?)" alt="PHP Logo" /></a>' |
47 | 47 | .'<h1>PHP Version (.*?)</h1>(?:\n+?)</td></tr>#', |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | '#</tr>#', |
53 | 53 | ), |
54 | 54 | array( |
55 | - '$1', '', '', '', '</$1>' . "\n", '<', ' ', ' ', ' ', '', ' ', |
|
55 | + '$1', '', '', '', '</$1>'."\n", '<', ' ', ' ', ' ', '', ' ', |
|
56 | 56 | '<h2>PHP Configuration</h2>'."\n".'<tr><td>PHP Version</td><td>$2</td></tr>'. |
57 | 57 | "\n".'<tr><td>PHP Egg</td><td>$1</td></tr>', |
58 | 58 | '<tr><td>PHP Credits Egg</td><td>$1</td></tr>', |
59 | - '<tr><td>Zend Engine</td><td>$2</td></tr>' . "\n" . '<tr><td>Zend Egg</td><td>$1</td></tr>', |
|
59 | + '<tr><td>Zend Engine</td><td>$2</td></tr>'."\n".'<tr><td>Zend Egg</td><td>$1</td></tr>', |
|
60 | 60 | ' ', |
61 | 61 | '%S%', |
62 | 62 | '%E%', |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | unset( $_aSections[ 0 ] ); |
69 | 69 | |
70 | 70 | $_aOutput = array(); |
71 | - foreach( $_aSections as $_sSection ) { |
|
71 | + foreach ( $_aSections as $_sSection ) { |
|
72 | 72 | $_iIndex = substr( $_sSection, 0, strpos( $_sSection, '</h2>' ) ); |
73 | 73 | preg_match_all( |
74 | 74 | '#%S%(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?(?:<td>(.*?)</td>)?%E%#', |
@@ -76,12 +76,12 @@ discard block |
||
76 | 76 | $_aAskApache, |
77 | 77 | PREG_SET_ORDER |
78 | 78 | ); |
79 | - foreach( $_aAskApache as $_aMatches ) { |
|
80 | - if ( ! isset( $_aMatches[ 1 ], $_aMatches[ 2 ] ) ) { |
|
79 | + foreach ( $_aAskApache as $_aMatches ) { |
|
80 | + if ( !isset( $_aMatches[ 1 ], $_aMatches[ 2 ] ) ) { |
|
81 | 81 | array_slice( $_aMatches, 2 ); |
82 | 82 | continue; |
83 | 83 | } |
84 | - $_aOutput[ $_iIndex ][ $_aMatches[ 1 ] ] = ! isset( $_aMatches[ 3 ] ) || $_aMatches[ 2 ] == $_aMatches[ 3 ] |
|
84 | + $_aOutput[ $_iIndex ][ $_aMatches[ 1 ] ] = !isset( $_aMatches[ 3 ] ) || $_aMatches[ 2 ] == $_aMatches[ 3 ] |
|
85 | 85 | ? $_aMatches[ 2 ] |
86 | 86 | : array_slice( $_aMatches, 2 ); |
87 | 87 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @since 3.4.6 |
99 | 99 | * @param array|string $asCategory The category key names of the returning array. |
100 | 100 | */ |
101 | - static public function getDefinedConstants( $asCategories=null, $asRemovingCategories=null ) { |
|
101 | + static public function getDefinedConstants( $asCategories = null, $asRemovingCategories = null ) { |
|
102 | 102 | |
103 | 103 | $_aCategories = is_array( $asCategories ) ? $asCategories : array( $asCategories ); |
104 | 104 | $_aCategories = array_filter( $_aCategories ); |
@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | |
128 | 128 | $_aPHPInfo = self::getPHPInfo(); |
129 | 129 | |
130 | - return isset( $_aPHPInfo['PHP Core']['error_log'] ) |
|
131 | - ? $_aPHPInfo['PHP Core']['error_log'] |
|
130 | + return isset( $_aPHPInfo[ 'PHP Core' ][ 'error_log' ] ) |
|
131 | + ? $_aPHPInfo[ 'PHP Core' ][ 'error_log' ] |
|
132 | 132 | : ''; |
133 | 133 | |
134 | 134 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * Returns a PHP error log. |
138 | 138 | * @since 3.4.6 |
139 | 139 | */ |
140 | - static public function getPHPErrorLog( $iLines=1 ) { |
|
140 | + static public function getPHPErrorLog( $iLines = 1 ) { |
|
141 | 141 | |
142 | 142 | $_sLog = self::getFileTailContents( self::getPHPErrorLogPath(), $iLines ); |
143 | 143 |
@@ -23,6 +23,7 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @since 2.0.0 |
25 | 25 | * @since 3.5.7 Moved from `AdminPageFramework_Utility`. |
26 | + * @param string $sQueryKey |
|
26 | 27 | * @return string|null |
27 | 28 | */ |
28 | 29 | static public function getQueryValueInURLByKey( $sURL, $sQueryKey ) { |
@@ -72,6 +73,7 @@ discard block |
||
72 | 73 | /** |
73 | 74 | * Returns the port suffix in the currently loading url. |
74 | 75 | * @since 3.5.7 |
76 | + * @param boolean $_bSSL |
|
75 | 77 | * @return string |
76 | 78 | */ |
77 | 79 | static private function _getURLPortSuffix( $_bSSL ) { |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | 0 => '', |
53 | 53 | 1 => 's', |
54 | 54 | ); |
55 | - $_sProtocol = substr( $_sServerProtocol, 0, strpos( $_sServerProtocol, '/' ) ) |
|
55 | + $_sProtocol = substr( $_sServerProtocol, 0, strpos( $_sServerProtocol, '/' ) ) |
|
56 | 56 | . $_aProrocolSuffix[ ( int ) $_bSSL ]; |
57 | 57 | |
58 | 58 | // Port: e.g. :80 |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | : $_SERVER[ 'SERVER_NAME' ] |
67 | 67 | ); |
68 | 68 | |
69 | - return $_sProtocol . '://' . $_sHost . $_sPort . $_SERVER[ 'REQUEST_URI' ]; |
|
69 | + return $_sProtocol.'://'.$_sHost.$_sPort.$_SERVER[ 'REQUEST_URI' ]; |
|
70 | 70 | |
71 | 71 | } |
72 | 72 | /** |
@@ -79,10 +79,10 @@ discard block |
||
79 | 79 | ? ( string ) $_SERVER[ 'SERVER_PORT' ] |
80 | 80 | : ''; |
81 | 81 | $_aPort = array( |
82 | - 0 => ':' . $_sPort, |
|
82 | + 0 => ':'.$_sPort, |
|
83 | 83 | 1 => '', |
84 | 84 | ); |
85 | - $_bPortSet = ( ! $_bSSL && '80' === $_sPort ) || ( $_bSSL && '443' === $_sPort ); |
|
85 | + $_bPortSet = ( !$_bSSL && '80' === $_sPort ) || ( $_bSSL && '443' === $_sPort ); |
|
86 | 86 | return $_aPort[ ( int ) $_bPortSet ]; |
87 | 87 | } |
88 | 88 |
@@ -89,11 +89,6 @@ discard block |
||
89 | 89 | * @access public |
90 | 90 | * @since 2.0.0 |
91 | 91 | * @remark Accepts variadic parameters. |
92 | - * @param object $oCallerObject the object that holds the callback method that matches the action hook name. |
|
93 | - * @param array $aActionHooks a numerically index array consisting of action hook names that serve as the callback method names. |
|
94 | - * @param mixed $vArgs1 the argument to pass to the hook callback functions. |
|
95 | - * @param mixed $vArgs2 another argument to pass to the hook callback functions. |
|
96 | - * @param mixed $_and_more add as many arguments as necessary to the next parameters. |
|
97 | 92 | * @return void |
98 | 93 | */ |
99 | 94 | static public function addAndDoActions( /* $oCallerObject, $aActionHooks, $vArgs1=null, $vArgs2=null, $_and_more=null */ ) { |
@@ -192,10 +187,6 @@ discard block |
||
192 | 187 | * ` |
193 | 188 | * |
194 | 189 | * @since 2.0.0 |
195 | - * @param object $oCallerObject |
|
196 | - * @param string $sFilter The filter hook name. |
|
197 | - * @param mixed $vData The filtering data |
|
198 | - * @param mixed $vArgs The arguments. |
|
199 | 190 | */ |
200 | 191 | static public function addAndApplyFilter( /* $oCallerObject, $sFilter, $vData, $vArgs... */ ) { |
201 | 192 | |
@@ -233,6 +224,7 @@ discard block |
||
233 | 224 | * |
234 | 225 | * @since 2.0.0 |
235 | 226 | * @access public |
227 | + * @param string $sPrefix |
|
236 | 228 | * @return array Returns an array consisting of the filters. |
237 | 229 | */ |
238 | 230 | static public function getFilterArrayByPrefix( $sPrefix, $sClassName, $sPageSlug, $sTabSlug, $bReverse=false ) { |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @since 3.4.2 |
27 | 27 | * @todo Create a similar function for filters. |
28 | 28 | */ |
29 | - static public function registerAction( $sActionHook, $oCallable, $iPriority=10 ) { |
|
29 | + static public function registerAction( $sActionHook, $oCallable, $iPriority = 10 ) { |
|
30 | 30 | |
31 | 31 | if ( did_action( $sActionHook ) ) { |
32 | 32 | return call_user_func_array( $oCallable, array() ); |
@@ -63,13 +63,13 @@ discard block |
||
63 | 63 | * @param mixed $_and_more add as many arguments as necessary to the next parameters. |
64 | 64 | * @return void does not return a value. |
65 | 65 | */ |
66 | - static public function doActions( $aActionHooks, $vArgs1=null, $vArgs2=null, $_and_more=null ) { |
|
66 | + static public function doActions( $aActionHooks, $vArgs1 = null, $vArgs2 = null, $_and_more = null ) { |
|
67 | 67 | |
68 | 68 | $aArgs = func_get_args(); |
69 | 69 | $aActionHooks = $aArgs[ 0 ]; |
70 | - foreach( ( array ) $aActionHooks as $sActionHook ) { |
|
70 | + foreach ( ( array ) $aActionHooks as $sActionHook ) { |
|
71 | 71 | $aArgs[ 0 ] = $sActionHook; |
72 | - call_user_func_array( 'do_action' , $aArgs ); |
|
72 | + call_user_func_array( 'do_action', $aArgs ); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | } |
@@ -101,12 +101,12 @@ discard block |
||
101 | 101 | $aArgs = func_get_args(); |
102 | 102 | $oCallerObject = $aArgs[ 0 ]; |
103 | 103 | $aActionHooks = $aArgs[ 1 ]; |
104 | - foreach( ( array ) $aActionHooks as $sActionHook ) { |
|
105 | - if ( ! $sActionHook ) { |
|
104 | + foreach ( ( array ) $aActionHooks as $sActionHook ) { |
|
105 | + if ( !$sActionHook ) { |
|
106 | 106 | continue; |
107 | 107 | } |
108 | 108 | $aArgs[ 1 ] = $sActionHook; |
109 | - call_user_func_array( array( get_class(), 'addAndDoAction' ) , $aArgs ); |
|
109 | + call_user_func_array( array( get_class(), 'addAndDoAction' ), $aArgs ); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | $_aArgs = func_get_args(); |
126 | 126 | $_oCallerObject = $_aArgs[ 0 ]; |
127 | 127 | $_sActionHook = $_aArgs[ 1 ]; |
128 | - if ( ! $_sActionHook ) { |
|
128 | + if ( !$_sActionHook ) { |
|
129 | 129 | return; |
130 | 130 | } |
131 | 131 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | |
138 | 138 | // Remove the first element, the caller object. |
139 | 139 | array_shift( $_aArgs ); |
140 | - call_user_func_array( 'do_action' , $_aArgs ); |
|
140 | + call_user_func_array( 'do_action', $_aArgs ); |
|
141 | 141 | |
142 | 142 | } |
143 | 143 | |
@@ -165,12 +165,12 @@ discard block |
||
165 | 165 | $_aFilters = $_aArgs[ 1 ]; |
166 | 166 | $_vInput = $_aArgs[ 2 ]; |
167 | 167 | |
168 | - foreach( ( array ) $_aFilters as $_sFilter ) { |
|
169 | - if ( ! $_sFilter ) { |
|
168 | + foreach ( ( array ) $_aFilters as $_sFilter ) { |
|
169 | + if ( !$_sFilter ) { |
|
170 | 170 | continue; |
171 | 171 | } |
172 | 172 | $_aArgs[ 1 ] = $_sFilter; |
173 | - $_aArgs[ 2 ] = $_vInput; // assigns the updated value as it is filtered in previous iterations |
|
173 | + $_aArgs[ 2 ] = $_vInput; // assigns the updated value as it is filtered in previous iterations |
|
174 | 174 | $_vInput = call_user_func_array( |
175 | 175 | array( get_class(), 'addAndApplyFilter' ), |
176 | 176 | $_aArgs |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $_aArgs = func_get_args(); |
206 | 206 | $_oCallerObject = $_aArgs[ 0 ]; |
207 | 207 | $_sFilter = $_aArgs[ 1 ]; |
208 | - if ( ! $_sFilter ) { |
|
208 | + if ( !$_sFilter ) { |
|
209 | 209 | return $_aArgs[ 2 ]; |
210 | 210 | } |
211 | 211 | |
@@ -237,17 +237,17 @@ discard block |
||
237 | 237 | * @access public |
238 | 238 | * @return array Returns an array consisting of the filters. |
239 | 239 | */ |
240 | - static public function getFilterArrayByPrefix( $sPrefix, $sClassName, $sPageSlug, $sTabSlug, $bReverse=false ) { |
|
240 | + static public function getFilterArrayByPrefix( $sPrefix, $sClassName, $sPageSlug, $sTabSlug, $bReverse = false ) { |
|
241 | 241 | |
242 | 242 | $_aFilters = array(); |
243 | 243 | if ( $sTabSlug && $sPageSlug ) { |
244 | - $_aFilters[] = "{$sPrefix}{$sPageSlug}_{$sTabSlug}"; |
|
244 | + $_aFilters[ ] = "{$sPrefix}{$sPageSlug}_{$sTabSlug}"; |
|
245 | 245 | } |
246 | 246 | if ( $sPageSlug ) { |
247 | - $_aFilters[] = "{$sPrefix}{$sPageSlug}"; |
|
247 | + $_aFilters[ ] = "{$sPrefix}{$sPageSlug}"; |
|
248 | 248 | } |
249 | 249 | if ( $sClassName ) { |
250 | - $_aFilters[] = "{$sPrefix}{$sClassName}"; |
|
250 | + $_aFilters[ ] = "{$sPrefix}{$sClassName}"; |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | return $bReverse |
@@ -284,6 +284,7 @@ |
||
284 | 284 | * Checkes whether the passed base url name is of the admin index page. |
285 | 285 | * @since 3.5.3 |
286 | 286 | * return boolean Whether the passed base url name is of the admin index page. |
287 | + * @param string $sPageNow |
|
287 | 288 | */ |
288 | 289 | static private function _isInAdminIndex( $sPageNow ) { |
289 | 290 | return in_array( |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | 'getPostTypeByTypeNow', |
59 | 59 | 'getPostTypeByScreenObject', |
60 | 60 | 'getPostTypeByREQUEST', |
61 | - 'getPostTypeByPostObject', // 3.6.0+ Moved to the last as it is not reliable. |
|
61 | + 'getPostTypeByPostObject', // 3.6.0+ Moved to the last as it is not reliable. |
|
62 | 62 | ); |
63 | 63 | foreach ( $_aMethodsToTry as $_sMethodName ) { |
64 | 64 | $_sPostType = call_user_func( array( __CLASS__, $_sMethodName ) ); |
@@ -123,9 +123,9 @@ discard block |
||
123 | 123 | * @param array|string The post type slug(s) to check. If this is empty, the method just checks the current page is a taxonomy page. |
124 | 124 | * @return boolean |
125 | 125 | */ |
126 | - static public function isCustomTaxonomyPage( $asPostTypes=array() ) { |
|
126 | + static public function isCustomTaxonomyPage( $asPostTypes = array() ) { |
|
127 | 127 | |
128 | - if ( ! in_array( self::getPageNow(), array( 'tags.php', 'edit-tags.php', ) ) ) { |
|
128 | + if ( !in_array( self::getPageNow(), array( 'tags.php', 'edit-tags.php',) ) ) { |
|
129 | 129 | return false; |
130 | 130 | } |
131 | 131 | |
@@ -141,10 +141,10 @@ discard block |
||
141 | 141 | * Otherwise, it will check if the page belongs to the given post type(s). |
142 | 142 | * @return boolean |
143 | 143 | */ |
144 | - static public function isPostDefinitionPage( $asPostTypes=array() ) { |
|
144 | + static public function isPostDefinitionPage( $asPostTypes = array() ) { |
|
145 | 145 | |
146 | 146 | // If it's not the post definition page, |
147 | - if ( ! in_array( self::getPageNow(), array( 'post.php', 'post-new.php', ) ) ) { |
|
147 | + if ( !in_array( self::getPageNow(), array( 'post.php', 'post-new.php',) ) ) { |
|
148 | 148 | return false; |
149 | 149 | } |
150 | 150 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * |
179 | 179 | * @since 3.0.0 |
180 | 180 | */ |
181 | - static public function isPostListingPage( $asPostTypes=array() ) { |
|
181 | + static public function isPostListingPage( $asPostTypes = array() ) { |
|
182 | 182 | |
183 | 183 | if ( 'edit.php' != self::getPageNow() ) { |
184 | 184 | return false; |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | |
187 | 187 | $_aPostTypes = self::getAsArray( $asPostTypes ); |
188 | 188 | |
189 | - if ( ! isset( $_GET[ 'post_type' ] ) ) { |
|
189 | + if ( !isset( $_GET[ 'post_type' ] ) ) { |
|
190 | 190 | return in_array( 'post', $_aPostTypes ); |
191 | 191 | } |
192 | 192 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | 0 => '_getPageNow_FrontEnd', |
226 | 226 | 1 => '_getPageNow_BackEnd', |
227 | 227 | ); |
228 | - $_sMethodName = $_aMethodNames[ ( integer ) is_admin() ]; |
|
228 | + $_sMethodName = $_aMethodNames[ ( integer ) is_admin() ]; |
|
229 | 229 | self::$_sPageNow = self::$_sMethodName(); |
230 | 230 | |
231 | 231 | return self::$_sPageNow; |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | |
325 | 325 | if ( isset( $GLBOALS[ 'page_hook' ] ) ) { |
326 | 326 | return is_network_admin() |
327 | - ? $GLBOALS[ 'page_hook' ] . '-network' |
|
327 | + ? $GLBOALS[ 'page_hook' ].'-network' |
|
328 | 328 | : $GLBOALS[ 'page_hook' ]; |
329 | 329 | } |
330 | 330 | |
@@ -338,11 +338,11 @@ discard block |
||
338 | 338 | * @since 3.7.0 |
339 | 339 | * @return boolean |
340 | 340 | */ |
341 | - static public function doesMetaBoxExist( $sContext='' ) { |
|
341 | + static public function doesMetaBoxExist( $sContext = '' ) { |
|
342 | 342 | |
343 | 343 | $_aDimensions = array( 'wp_meta_boxes', $GLOBALS[ 'page_hook' ] ); |
344 | 344 | if ( $sContext ) { |
345 | - $_aDimensions[] = $sContext; |
|
345 | + $_aDimensions[ ] = $sContext; |
|
346 | 346 | } |
347 | 347 | $_aSideMetaBoxes = self::getElementAsArray( |
348 | 348 | $GLOBALS, |
@@ -281,11 +281,9 @@ |
||
281 | 281 | |
282 | 282 | if ( is_network_admin() ) { |
283 | 283 | $_sNeedle = '#/wp-admin/network/?(.*?)$#i'; |
284 | - } |
|
285 | - else if ( is_user_admin() ) { |
|
284 | + } else if ( is_user_admin() ) { |
|
286 | 285 | $_sNeedle = '#/wp-admin/user/?(.*?)$#i'; |
287 | - } |
|
288 | - else { |
|
286 | + } else { |
|
289 | 287 | $_sNeedle = '#/wp-admin/?(.*?)$#i'; |
290 | 288 | } |
291 | 289 | preg_match( $_sNeedle, $_SERVER[ 'PHP_SELF' ], $_aMatches ); |
@@ -27,6 +27,7 @@ discard block |
||
27 | 27 | * Sets up hooks |
28 | 28 | * |
29 | 29 | * @internal |
30 | + * @param AdminPageFramework_Model_Menu $oFactory |
|
30 | 31 | */ |
31 | 32 | public function __construct( $oFactory, $sActionHook='admin_menu' ) { |
32 | 33 | |
@@ -228,6 +229,7 @@ discard block |
||
228 | 229 | * @since 3.3.0 |
229 | 230 | * @since 3.1.1 Moved from `AdminPageFramework_Menu`. |
230 | 231 | * @since 3.7.4 Added the `$nOrder` parameter. |
232 | + * @param string $sMenuSlug |
|
231 | 233 | * @return string The page hook of the added page. |
232 | 234 | * @uses add_submenu_page |
233 | 235 | */ |
@@ -340,7 +342,7 @@ discard block |
||
340 | 342 | /** |
341 | 343 | * @since 3.7.4 |
342 | 344 | * @return void |
343 | - * @param numeric $$nOrder A user set order (menu position, index). |
|
345 | + * @param numeric $nOrder A user set order (menu position, index). |
|
344 | 346 | * @param array $aSubMenuItem The sub menu item array set in the global `$submenu` array. |
345 | 347 | */ |
346 | 348 | private function _setSubMenuPageByIndex( $nOrder, $aSubMenuItem, $sMenuSlug ) { |
@@ -464,6 +466,7 @@ discard block |
||
464 | 466 | * @since 3.1.1 Moved from `AdminPageFramework_Menu`. |
465 | 467 | * @since 3.5.3 Added the `$bShowInMenu` parameter. |
466 | 468 | * @since 3.7.4 Added the `$nOrder` parameter. |
469 | + * @param string $sMenuSlug |
|
467 | 470 | * @return void |
468 | 471 | */ |
469 | 472 | private function _addLinkSubmenuItem( $sMenuSlug, $sTitle, $sCapability, $sHref, $bShowInMenu, $nOrder ) { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @internal |
30 | 30 | */ |
31 | - public function __construct( $oFactory, $sActionHook='admin_menu' ) { |
|
31 | + public function __construct( $oFactory, $sActionHook = 'admin_menu' ) { |
|
32 | 32 | |
33 | 33 | $this->oFactory = $oFactory; |
34 | 34 | |
@@ -71,8 +71,8 @@ discard block |
||
71 | 71 | |
72 | 72 | // Apply filters to let other scripts add sub menu pages. |
73 | 73 | $this->oFactory->oProp->aPages = $this->addAndApplyFilter( |
74 | - $this->oFactory, // caller object |
|
75 | - "pages_{$this->oFactory->oProp->sClassName}", // filter |
|
74 | + $this->oFactory, // caller object |
|
75 | + "pages_{$this->oFactory->oProp->sClassName}", // filter |
|
76 | 76 | $this->oFactory->oProp->aPages // arguments |
77 | 77 | ); |
78 | 78 | |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | |
121 | 121 | foreach ( $this->oFactory->oProp->aPages as $_aPage ) { |
122 | 122 | |
123 | - if ( ! isset( $_aPage[ 'page_slug' ] ) ) { |
|
123 | + if ( !isset( $_aPage[ 'page_slug' ] ) ) { |
|
124 | 124 | continue; |
125 | 125 | } |
126 | 126 | $this->oFactory->oProp->sDefaultPageSlug = $_aPage[ 'page_slug' ]; |
@@ -141,12 +141,12 @@ discard block |
||
141 | 141 | private function _registerRootMenuPage() { |
142 | 142 | |
143 | 143 | $this->oFactory->oProp->aRootMenu[ '_page_hook' ] = add_menu_page( |
144 | - $this->oFactory->oProp->sClassName, // Page title - will be invisible anyway |
|
145 | - $this->oFactory->oProp->aRootMenu[ 'sTitle' ], // Menu title - should be the root page title. |
|
146 | - $this->oFactory->oProp->sCapability, // Capability - access right |
|
147 | - $this->oFactory->oProp->aRootMenu[ 'sPageSlug' ], // Menu ID |
|
148 | - '', // Callback function for the page content output - the root page will be removed so no need to register a function. |
|
149 | - $this->oFactory->oProp->aRootMenu[ 'sIcon16x16' ], // icon path |
|
144 | + $this->oFactory->oProp->sClassName, // Page title - will be invisible anyway |
|
145 | + $this->oFactory->oProp->aRootMenu[ 'sTitle' ], // Menu title - should be the root page title. |
|
146 | + $this->oFactory->oProp->sCapability, // Capability - access right |
|
147 | + $this->oFactory->oProp->aRootMenu[ 'sPageSlug' ], // Menu ID |
|
148 | + '', // Callback function for the page content output - the root page will be removed so no need to register a function. |
|
149 | + $this->oFactory->oProp->aRootMenu[ 'sIcon16x16' ], // icon path |
|
150 | 150 | $this->getElement( |
151 | 151 | $this->oFactory->oProp->aRootMenu, |
152 | 152 | 'iPosition', |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | */ |
170 | 170 | private function _registerSubMenuItem( array $aArgs ) { |
171 | 171 | |
172 | - if ( ! current_user_can( $aArgs[ 'capability' ] ) ) { |
|
172 | + if ( !current_user_can( $aArgs[ 'capability' ] ) ) { |
|
173 | 173 | return ''; |
174 | 174 | } |
175 | 175 | |
@@ -235,16 +235,16 @@ discard block |
||
235 | 235 | */ |
236 | 236 | private function _addPageSubmenuItem( $sRootPageSlug, $sMenuSlug, $sPageSlug, $sPageTitle, $sMenuTitle, $sCapability, $bShowInMenu, $nOrder ) { |
237 | 237 | |
238 | - if ( ! $sPageSlug ) { |
|
238 | + if ( !$sPageSlug ) { |
|
239 | 239 | return ''; |
240 | 240 | } |
241 | 241 | |
242 | 242 | $_sPageHook = add_submenu_page( |
243 | - $sRootPageSlug, // the root (parent) page slug |
|
244 | - $sPageTitle, // page title |
|
245 | - $sMenuTitle, // menu title |
|
246 | - $sCapability, // capability |
|
247 | - $sPageSlug, // menu slug |
|
243 | + $sRootPageSlug, // the root (parent) page slug |
|
244 | + $sPageTitle, // page title |
|
245 | + $sMenuTitle, // menu title |
|
246 | + $sCapability, // capability |
|
247 | + $sPageSlug, // menu slug |
|
248 | 248 | /** |
249 | 249 | * In admin.php ( line 149 of WordPress v3.6.1 ), do_action($page_hook) ( where $page_hook is $_sPageHook ) |
250 | 250 | * will be executed and it triggers the __call() magic method with the method name of "md5 class hash + _page_ + this page slug". |
@@ -269,14 +269,14 @@ discard block |
||
269 | 269 | $_aRemovedMenuItem = $this->_removePageSubmenuItem( $_nSubMenuPageIndex, $sMenuSlug, $sPageSlug, $sMenuTitle ); |
270 | 270 | |
271 | 271 | // If the visibility option is `false`, remove the one just added from the sub-menu global array |
272 | - if ( ! $bShowInMenu && ! $this->_isCurrentPage( $sPageSlug ) ) { |
|
272 | + if ( !$bShowInMenu && !$this->_isCurrentPage( $sPageSlug ) ) { |
|
273 | 273 | return $_sPageHook; |
274 | 274 | } |
275 | 275 | |
276 | 276 | // Set the order index in the element of the `submenu` global array. |
277 | 277 | $this->_setSubMenuPageByIndex( |
278 | - $nOrder, // user-set order |
|
279 | - $_aRemovedMenuItem, // will be reassign with a new index |
|
278 | + $nOrder, // user-set order |
|
279 | + $_aRemovedMenuItem, // will be reassign with a new index |
|
280 | 280 | $sMenuSlug |
281 | 281 | ); |
282 | 282 | |
@@ -316,7 +316,7 @@ discard block |
||
316 | 316 | */ |
317 | 317 | add_action( |
318 | 318 | 'current_screen', |
319 | - array( $this->oFactory, "load_pre_" . $sPageSlug ), |
|
319 | + array( $this->oFactory, "load_pre_".$sPageSlug ), |
|
320 | 320 | 20 |
321 | 321 | ); |
322 | 322 | |
@@ -325,15 +325,15 @@ discard block |
||
325 | 325 | * Set a low priority because the user may add in-page tabs in their callback method of this action hook. |
326 | 326 | * @since 3.6.3 |
327 | 327 | */ |
328 | - add_action( "load_" . $sPageSlug, array( $this->oFactory, '_replyToFinalizeInPageTabs' ), 9999 ); |
|
328 | + add_action( "load_".$sPageSlug, array( $this->oFactory, '_replyToFinalizeInPageTabs' ), 9999 ); |
|
329 | 329 | |
330 | 330 | // 3.6.3+ |
331 | - add_action( "load_after_" . $sPageSlug, array( $this->oFactory, '_replyToEnqueuePageAssets' ) ); |
|
332 | - add_action( "load_after_" . $sPageSlug, array( $this->oFactory, '_replyToEnablePageMetaBoxes' ) ); // 3.7.10+ |
|
331 | + add_action( "load_after_".$sPageSlug, array( $this->oFactory, '_replyToEnqueuePageAssets' ) ); |
|
332 | + add_action( "load_after_".$sPageSlug, array( $this->oFactory, '_replyToEnablePageMetaBoxes' ) ); // 3.7.10+ |
|
333 | 333 | |
334 | 334 | $this->oFactory->oProp->aPageHooks[ $sPageSlug ] = $this->getAOrB( |
335 | 335 | is_network_admin(), |
336 | - $sPageHook . '-network', |
|
336 | + $sPageHook.'-network', |
|
337 | 337 | $sPageHook |
338 | 338 | ); |
339 | 339 | |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | |
351 | 351 | $_nNewIndex = $this->getUnusedNumericIndex( |
352 | 352 | $this->getElementAsArray( $GLOBALS, array( 'submenu', $sMenuSlug ) ), // subject array to parser |
353 | - $nOrder, // a desired menu position |
|
353 | + $nOrder, // a desired menu position |
|
354 | 354 | 5 // offset |
355 | 355 | ); |
356 | 356 | |
@@ -364,9 +364,9 @@ discard block |
||
364 | 364 | */ |
365 | 365 | private function _getSubMenuPageIndex( $sMenuSlug, $sMenuTitle, $sPageTitle, $sPageSlug ) { |
366 | 366 | |
367 | - foreach( $this->getElementAsArray( $GLOBALS, array( 'submenu', $sMenuSlug ) ) as $_iIndex => $_aSubMenu ) { |
|
367 | + foreach ( $this->getElementAsArray( $GLOBALS, array( 'submenu', $sMenuSlug ) ) as $_iIndex => $_aSubMenu ) { |
|
368 | 368 | |
369 | - if ( ! isset( $_aSubMenu[ 3 ] ) ) { |
|
369 | + if ( !isset( $_aSubMenu[ 3 ] ) ) { |
|
370 | 370 | continue; |
371 | 371 | } |
372 | 372 | |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | * @since 3.1.1 Moved from `AdminPageFramework_Menu`. Chagned the return type. |
401 | 401 | * @return array removed menu item. |
402 | 402 | */ |
403 | - private function _removePageSubmenuItem( $nSubMenuPageIndex, $sMenuSlug, $sPageSlug, $sMenuTitle ){ |
|
403 | + private function _removePageSubmenuItem( $nSubMenuPageIndex, $sMenuSlug, $sPageSlug, $sMenuTitle ) { |
|
404 | 404 | |
405 | 405 | $_aRemovedMenuItem = $this->_removePageSubMenuItemByIndex( |
406 | 406 | $nSubMenuPageIndex, |
@@ -474,7 +474,7 @@ discard block |
||
474 | 474 | */ |
475 | 475 | private function _addLinkSubmenuItem( $sMenuSlug, $sTitle, $sCapability, $sHref, $bShowInMenu, $nOrder ) { |
476 | 476 | |
477 | - if ( ! $bShowInMenu ) { |
|
477 | + if ( !$bShowInMenu ) { |
|
478 | 478 | return; |
479 | 479 | } |
480 | 480 | |
@@ -489,9 +489,9 @@ discard block |
||
489 | 489 | 5 // offset |
490 | 490 | ); |
491 | 491 | $_aSubMenuItems[ $_nIndex ] = array( |
492 | - $sTitle, // 0 |
|
493 | - $sCapability, // 1 |
|
494 | - $sHref, // 2 |
|
492 | + $sTitle, // 0 |
|
493 | + $sCapability, // 1 |
|
494 | + $sHref, // 2 |
|
495 | 495 | ); |
496 | 496 | $GLOBALS[ 'submenu' ][ $sMenuSlug ] = $_aSubMenuItems; |
497 | 497 |
@@ -400,7 +400,7 @@ |
||
400 | 400 | * @since 3.1.1 Moved from `AdminPageFramework_Menu`. Chagned the return type. |
401 | 401 | * @return array removed menu item. |
402 | 402 | */ |
403 | - private function _removePageSubmenuItem( $nSubMenuPageIndex, $sMenuSlug, $sPageSlug, $sMenuTitle ){ |
|
403 | + private function _removePageSubmenuItem( $nSubMenuPageIndex, $sMenuSlug, $sPageSlug, $sMenuTitle ) { |
|
404 | 404 | |
405 | 405 | $_aRemovedMenuItem = $this->_removePageSubMenuItemByIndex( |
406 | 406 | $nSubMenuPageIndex, |
@@ -224,6 +224,7 @@ discard block |
||
224 | 224 | * @param string the tagged HTML link text. |
225 | 225 | * @param string (optional) another tagged HTML link text. |
226 | 226 | * @param string (optional) add more as many as want by adding items to the next parameters. |
227 | + * @param string $sTaggedLinkHTML1 |
|
227 | 228 | * @access public |
228 | 229 | * @return void |
229 | 230 | */ |
@@ -249,6 +250,9 @@ discard block |
||
249 | 250 | * @param string the tagged HTML link text. |
250 | 251 | * @param string (optional) another tagged HTML link text. |
251 | 252 | * @param string (optional) add more as many as want by adding items to the next parameters. |
253 | + * @param null|string $sTaggedLinkHTML1 |
|
254 | + * @param string $sTaggedLinkHTML2 |
|
255 | + * @param string $_and_more |
|
252 | 256 | * @access public |
253 | 257 | * @return void |
254 | 258 | */ |
@@ -268,6 +272,7 @@ discard block |
||
268 | 272 | * |
269 | 273 | * @since 3.1.0 |
270 | 274 | * @since 3.3.1 Moved from `AdminPageFramework`. |
275 | + * @param string $sLabel |
|
271 | 276 | */ |
272 | 277 | public function setPluginSettingsLinkLabel( $sLabel ) { |
273 | 278 | $this->oProp->sLabelPluginSettingsLink = $sLabel; |
@@ -219,24 +219,24 @@ discard block |
||
219 | 219 | } |
220 | 220 | |
221 | 221 | /** |
222 | - * Adds the given link(s) into the description cell of the plugin listing table. |
|
223 | - * |
|
224 | - * <h4>Example</h4> |
|
225 | - * <code>$this->addLinkToPluginDescription( |
|
226 | - * "<a href='http://www.google.com'>Google</a>", |
|
227 | - * "<a href='http://www.yahoo.com'>Yahoo!</a>" |
|
228 | - * );</code> |
|
229 | - * |
|
230 | - * @since 2.0.0 |
|
231 | - * @since 3.0.0 Changed the scope to public from protected. |
|
232 | - * @since 3.3.1 Moved from `AdminPageFramework`. |
|
233 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
234 | - * @param string the tagged HTML link text. |
|
235 | - * @param string (optional) another tagged HTML link text. |
|
236 | - * @param string (optional) add more as many as want by adding items to the next parameters. |
|
237 | - * @access public |
|
238 | - * @return void |
|
239 | - */ |
|
222 | + * Adds the given link(s) into the description cell of the plugin listing table. |
|
223 | + * |
|
224 | + * <h4>Example</h4> |
|
225 | + * <code>$this->addLinkToPluginDescription( |
|
226 | + * "<a href='http://www.google.com'>Google</a>", |
|
227 | + * "<a href='http://www.yahoo.com'>Yahoo!</a>" |
|
228 | + * );</code> |
|
229 | + * |
|
230 | + * @since 2.0.0 |
|
231 | + * @since 3.0.0 Changed the scope to public from protected. |
|
232 | + * @since 3.3.1 Moved from `AdminPageFramework`. |
|
233 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
234 | + * @param string the tagged HTML link text. |
|
235 | + * @param string (optional) another tagged HTML link text. |
|
236 | + * @param string (optional) add more as many as want by adding items to the next parameters. |
|
237 | + * @access public |
|
238 | + * @return void |
|
239 | + */ |
|
240 | 240 | public function addLinkToPluginDescription( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
241 | 241 | if ( 'plugins.php' !== $this->oProp->sPageNow ) { |
242 | 242 | return; |
@@ -245,23 +245,23 @@ discard block |
||
245 | 245 | } |
246 | 246 | |
247 | 247 | /** |
248 | - * Adds the given link(s) into the title cell of the plugin listing table. |
|
249 | - * |
|
250 | - * <h4>Example</h4> |
|
251 | - * <code>$this->addLinkToPluginTitle( |
|
252 | - * "<a href='http://www.wordpress.org'>WordPress</a>" |
|
253 | - * );</code> |
|
254 | - * |
|
255 | - * @since 2.0.0 |
|
256 | - * @since 3.0.0 Changed the scope to public from protected. |
|
257 | - * @since 3.3.1 Moved from `AdminPageFramework`. |
|
258 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
259 | - * @param string the tagged HTML link text. |
|
260 | - * @param string (optional) another tagged HTML link text. |
|
261 | - * @param string (optional) add more as many as want by adding items to the next parameters. |
|
262 | - * @access public |
|
263 | - * @return void |
|
264 | - */ |
|
248 | + * Adds the given link(s) into the title cell of the plugin listing table. |
|
249 | + * |
|
250 | + * <h4>Example</h4> |
|
251 | + * <code>$this->addLinkToPluginTitle( |
|
252 | + * "<a href='http://www.wordpress.org'>WordPress</a>" |
|
253 | + * );</code> |
|
254 | + * |
|
255 | + * @since 2.0.0 |
|
256 | + * @since 3.0.0 Changed the scope to public from protected. |
|
257 | + * @since 3.3.1 Moved from `AdminPageFramework`. |
|
258 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
259 | + * @param string the tagged HTML link text. |
|
260 | + * @param string (optional) another tagged HTML link text. |
|
261 | + * @param string (optional) add more as many as want by adding items to the next parameters. |
|
262 | + * @access public |
|
263 | + * @return void |
|
264 | + */ |
|
265 | 265 | public function addLinkToPluginTitle( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
266 | 266 | |
267 | 267 | if ( 'plugins.php' !== $this->oProp->sPageNow ) { |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * @param array $aCustomArgs (optional) The argument array for more advanced parameters. |
116 | 116 | * @return array The array holing the queued items. |
117 | 117 | */ |
118 | - public function enqueueStyles( $aSRCs, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
118 | + public function enqueueStyles( $aSRCs, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
119 | 119 | return $this->oResource->_enqueueStyles( $aSRCs, $sPageSlug, $sTabSlug, $aCustomArgs ); |
120 | 120 | } |
121 | 121 | /** |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * </ul> |
151 | 151 | * @return string The style handle ID. If the passed url is not a valid url string, an empty string will be returned. |
152 | 152 | */ |
153 | - public function enqueueStyle( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
153 | + public function enqueueStyle( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
154 | 154 | return $this->oResource->_enqueueStyle( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
155 | 155 | } |
156 | 156 | /** |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | * @param array (optional) The argument array for more advanced parameters. |
176 | 176 | * @return array The array holding the queued items. |
177 | 177 | */ |
178 | - public function enqueueScripts( $aSRCs, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
178 | + public function enqueueScripts( $aSRCs, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
179 | 179 | return $this->oResource->_enqueueScripts( $aSRCs, $sPageSlug, $sTabSlug, $aCustomArgs ); |
180 | 180 | } |
181 | 181 | /** |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | * </ul> |
215 | 215 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
216 | 216 | */ |
217 | - public function enqueueScript( $sSRC, $sPageSlug='', $sTabSlug='', $aCustomArgs=array() ) { |
|
217 | + public function enqueueScript( $sSRC, $sPageSlug = '', $sTabSlug = '', $aCustomArgs = array() ) { |
|
218 | 218 | return $this->oResource->_enqueueScript( $sSRC, $sPageSlug, $sTabSlug, $aCustomArgs ); |
219 | 219 | } |
220 | 220 | |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | * @access public |
238 | 238 | * @return void |
239 | 239 | */ |
240 | - public function addLinkToPluginDescription( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
|
240 | + public function addLinkToPluginDescription( $sTaggedLinkHTML1, $sTaggedLinkHTML2 = null, $_and_more = null ) { |
|
241 | 241 | if ( 'plugins.php' !== $this->oProp->sPageNow ) { |
242 | 242 | return; |
243 | 243 | } |
@@ -262,7 +262,7 @@ discard block |
||
262 | 262 | * @access public |
263 | 263 | * @return void |
264 | 264 | */ |
265 | - public function addLinkToPluginTitle( $sTaggedLinkHTML1, $sTaggedLinkHTML2=null, $_and_more=null ) { |
|
265 | + public function addLinkToPluginTitle( $sTaggedLinkHTML1, $sTaggedLinkHTML2 = null, $_and_more = null ) { |
|
266 | 266 | |
267 | 267 | if ( 'plugins.php' !== $this->oProp->sPageNow ) { |
268 | 268 | return; |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | * @param string (optional) The class selector used in the message HTML element. 'error' and 'updated' are prepared by WordPress but it's not limited to them and can pass a custom name. Default: 'error'. |
322 | 322 | * @param string (optional) The ID of the message. If not set, the hash of the message will be used. |
323 | 323 | */ |
324 | - public function setAdminNotice( $sMessage, $sClassSelector='error', $sID='' ) { |
|
324 | + public function setAdminNotice( $sMessage, $sClassSelector = 'error', $sID = '' ) { |
|
325 | 325 | |
326 | 326 | $sID = $sID ? $sID : md5( $sMessage ); |
327 | 327 | |
@@ -358,9 +358,9 @@ discard block |
||
358 | 358 | * @param boolean If true, the passed key(s) will be appended to the property; otherwise, it will override the property. |
359 | 359 | * @return void |
360 | 360 | */ |
361 | - public function setDisallowedQueryKeys( $asQueryKeys, $bAppend=true ) { |
|
361 | + public function setDisallowedQueryKeys( $asQueryKeys, $bAppend = true ) { |
|
362 | 362 | |
363 | - if ( ! $bAppend ) { |
|
363 | + if ( !$bAppend ) { |
|
364 | 364 | $this->oProp->aDisallowedQueryKeys = ( array ) $asQueryKeys; |
365 | 365 | |
366 | 366 | return; |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | * @param mixed $vDefault the default value that will be returned if nothing is stored. |
405 | 405 | * @return mixed If the field ID is not specified |
406 | 406 | */ |
407 | - static public function getOption( $sOptionKey, $asKey=null, $vDefault=null ) { |
|
407 | + static public function getOption( $sOptionKey, $asKey = null, $vDefault = null ) { |
|
408 | 408 | return AdminPageFramework_WPUtility::getOption( $sOptionKey, $asKey, $vDefault ); |
409 | 409 | } |
410 | 410 |
@@ -26,6 +26,7 @@ |
||
26 | 26 | * Sets up hooks and properties. |
27 | 27 | * |
28 | 28 | * @internal |
29 | + * @param AdminPageFramework_PostType_Model $oFactory |
|
29 | 30 | */ |
30 | 31 | public function __construct( $oFactory ) { |
31 | 32 |
@@ -277,7 +277,7 @@ |
||
277 | 277 | ); |
278 | 278 | } |
279 | 279 | |
280 | - /** |
|
280 | + /** |
|
281 | 281 | * Extracts meta box form fields options array from the given options array of an admin page. |
282 | 282 | * |
283 | 283 | * @since 3.5.6 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function __construct( $oFactory ) { |
31 | 31 | |
32 | - if ( ! $this->_shouldProceed( $oFactory ) ) { |
|
32 | + if ( !$this->_shouldProceed( $oFactory ) ) { |
|
33 | 33 | return; |
34 | 34 | } |
35 | 35 | |
@@ -54,10 +54,10 @@ discard block |
||
54 | 54 | */ |
55 | 55 | private function _shouldProceed( $oFactory ) { |
56 | 56 | |
57 | - if ( ! $oFactory->oProp->bIsAdmin ) { |
|
57 | + if ( !$oFactory->oProp->bIsAdmin ) { |
|
58 | 58 | return false; |
59 | 59 | } |
60 | - if ( ! $oFactory->oProp->sCallerPath ) { |
|
60 | + if ( !$oFactory->oProp->sCallerPath ) { |
|
61 | 61 | return false; |
62 | 62 | } |
63 | 63 | return 'plugin' === $oFactory->oProp->sScriptType; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | // If the execution flow in the plugin activation hook, schedule flushing rewrite rules. |
90 | - if ( did_action( 'activate_' . plugin_basename( $this->oFactory->oProp->sCallerPath ) ) ) { |
|
90 | + if ( did_action( 'activate_'.plugin_basename( $this->oFactory->oProp->sCallerPath ) ) ) { |
|
91 | 91 | add_action( 'shutdown', array( $this, '_replyToFlushRewriteRules' ) ); |
92 | 92 | } |
93 | 93 |
@@ -26,6 +26,7 @@ discard block |
||
26 | 26 | * Sets up hooks and properties. |
27 | 27 | * |
28 | 28 | * @internal |
29 | + * @param AdminPageFramework_PostType_Model $oFactory |
|
29 | 30 | */ |
30 | 31 | public function __construct( $oFactory ) { |
31 | 32 | |
@@ -82,6 +83,7 @@ discard block |
||
82 | 83 | |
83 | 84 | /** |
84 | 85 | * @since 3.7.4 |
86 | + * @param string $sSubMenuSlug |
|
85 | 87 | */ |
86 | 88 | private function _setSubMenuSlugForSorting( $sSubMenuSlug ) { |
87 | 89 | |
@@ -94,6 +96,7 @@ discard block |
||
94 | 96 | |
95 | 97 | /** |
96 | 98 | * @since 3.7.4 |
99 | + * @param string $sSubMenuSlug |
|
97 | 100 | */ |
98 | 101 | private function _setSubMenuItemIndex( $sSubMenuSlug ) { |
99 | 102 |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | $this->oFactory = $oFactory; |
33 | 33 | |
34 | - if ( ! $oFactory->oProp->bIsAdmin ) { |
|
34 | + if ( !$oFactory->oProp->bIsAdmin ) { |
|
35 | 35 | return; |
36 | 36 | } |
37 | 37 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | add_action( |
49 | 49 | 'admin_menu', |
50 | - array( $this, 'sortAdminSubMenu' ), // defined in the framework utility class. |
|
50 | + array( $this, 'sortAdminSubMenu' ), // defined in the framework utility class. |
|
51 | 51 | 9999 |
52 | 52 | ); |
53 | 53 | |
@@ -62,15 +62,15 @@ discard block |
||
62 | 62 | |
63 | 63 | // Check the post type `show_ui` and other related UI arguments. |
64 | 64 | $_bsShowInMeenu = $this->getShowInMenuPostTypeArgument( $this->oFactory->oProp->aPostTypeArgs ); |
65 | - if ( ! $_bsShowInMeenu ) { |
|
65 | + if ( !$_bsShowInMeenu ) { |
|
66 | 66 | return; |
67 | 67 | } |
68 | 68 | |
69 | 69 | // If the user sets a menu slug to the 'show_in_menu' argument, use that. |
70 | 70 | // It is used to set a custom post type sub-menu belong to another menu. |
71 | - $_sSubMenuSlug = is_string( $_bsShowInMeenu ) |
|
71 | + $_sSubMenuSlug = is_string( $_bsShowInMeenu ) |
|
72 | 72 | ? $_bsShowInMeenu |
73 | - : 'edit.php?post_type=' . $this->oFactory->oProp->sPostType; |
|
73 | + : 'edit.php?post_type='.$this->oFactory->oProp->sPostType; |
|
74 | 74 | |
75 | 75 | // Set the index to the framework specific global array for sorting. |
76 | 76 | $this->_setSubMenuSlugForSorting( $_sSubMenuSlug ); |
@@ -131,11 +131,11 @@ discard block |
||
131 | 131 | |
132 | 132 | // @remark This is the partial link url set in the third element ( index of 2 ) in the third dimension of submenu global array element. |
133 | 133 | // This is not the submenu slug. |
134 | - $_sLinkSlugManage = 'edit.php?post_type=' . $this->oFactory->oProp->sPostType; |
|
134 | + $_sLinkSlugManage = 'edit.php?post_type='.$this->oFactory->oProp->sPostType; |
|
135 | 135 | |
136 | 136 | $_aLinkSlugs = array( |
137 | 137 | $_sLinkSlugManage => $_nSubMenuOrderManage, |
138 | - 'post-new.php?post_type=' . $this->oFactory->oProp->sPostType => $_nSubMenuOrderAddNew, |
|
138 | + 'post-new.php?post_type='.$this->oFactory->oProp->sPostType => $_nSubMenuOrderAddNew, |
|
139 | 139 | ); |
140 | 140 | |
141 | 141 | // If the user does not set a custom value, unset it |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | } |
145 | 145 | |
146 | 146 | // If the user does not want to show the Add New sub menu, no need to change the order. |
147 | - if ( ! $_bShowAddNew || 10 == $_nSubMenuOrderAddNew ) { |
|
148 | - unset( $_aLinkSlugs[ 'post-new.php?post_type=' . $this->oFactory->oProp->sPostType ] ); |
|
147 | + if ( !$_bShowAddNew || 10 == $_nSubMenuOrderAddNew ) { |
|
148 | + unset( $_aLinkSlugs[ 'post-new.php?post_type='.$this->oFactory->oProp->sPostType ] ); |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | return $_aLinkSlugs; |
@@ -165,9 +165,9 @@ discard block |
||
165 | 165 | */ |
166 | 166 | private function _setSubMenuIndexByLinksSlugs( $sSubMenuSlug, array $aLinkSlugs ) { |
167 | 167 | |
168 | - foreach( $this->getElementAsArray( $GLOBALS, array( 'submenu', $sSubMenuSlug ) ) as $_nIndex => $_aSubMenuItem ) { |
|
168 | + foreach ( $this->getElementAsArray( $GLOBALS, array( 'submenu', $sSubMenuSlug ) ) as $_nIndex => $_aSubMenuItem ) { |
|
169 | 169 | |
170 | - foreach( $aLinkSlugs as $_sLinkSlug => $_nOrder ) { |
|
170 | + foreach ( $aLinkSlugs as $_sLinkSlug => $_nOrder ) { |
|
171 | 171 | |
172 | 172 | $_bIsSet = $this->_setSubMenuIndexByLinksSlug( $sSubMenuSlug, $_nIndex, $_aSubMenuItem, $_sLinkSlug, $_nOrder ); |
173 | 173 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | private function _setSubMenuIndexByLinksSlug( $sSubMenuSlug, $nIndex, $aSubMenuItem, $sLinkSlug, $nOrder ) { |
194 | 194 | |
195 | 195 | // The third item is the link slug. |
196 | - if ( ! isset( $aSubMenuItem[ 2 ] ) ) { |
|
196 | + if ( !isset( $aSubMenuItem[ 2 ] ) ) { |
|
197 | 197 | return false; |
198 | 198 | } |
199 | 199 | if ( $aSubMenuItem[ 2 ] !== $sLinkSlug ) { |