@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * @param string The text domain. Default: `admin-page-framework`. |
46 | 46 | * @return void |
47 | 47 | */ |
48 | - public function __construct( $asTaxonomySlug, $sCapability='manage_options', $sTextDomain='admin-page-framework' ) { |
|
48 | + public function __construct( $asTaxonomySlug, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework' ) { |
|
49 | 49 | |
50 | 50 | if ( empty( $asTaxonomySlug ) ) { |
51 | 51 | return; |
@@ -54,15 +54,15 @@ discard block |
||
54 | 54 | // Properties |
55 | 55 | $_sPropertyClassName = isset( $this->aSubClassNames[ 'oProp' ] ) |
56 | 56 | ? $this->aSubClassNames[ 'oProp' ] |
57 | - : 'AdminPageFramework_Property_' . $this->_sStructureType; |
|
58 | - $this->oProp = new $_sPropertyClassName( |
|
57 | + : 'AdminPageFramework_Property_'.$this->_sStructureType; |
|
58 | + $this->oProp = new $_sPropertyClassName( |
|
59 | 59 | $this, |
60 | 60 | get_class( $this ), |
61 | 61 | $sCapability, |
62 | 62 | $sTextDomain, |
63 | 63 | $this->_sStructureType |
64 | 64 | ); |
65 | - $this->oProp->aTaxonomySlugs = ( array ) $asTaxonomySlug; |
|
65 | + $this->oProp->aTaxonomySlugs = ( array ) $asTaxonomySlug; |
|
66 | 66 | |
67 | 67 | parent::__construct( $this->oProp ); |
68 | 68 |
@@ -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 | . $_aProtocolSuffix[ ( int ) $_bSSL ]; |
57 | 57 | |
58 | 58 | // Port: e.g. :80 |
@@ -65,8 +65,8 @@ discard block |
||
65 | 65 | ? $_SERVER[ 'HTTP_HOST' ] |
66 | 66 | : $_SERVER[ 'SERVER_NAME' ] |
67 | 67 | ); |
68 | - $_sHost = preg_replace( '/:.+/', '', $_sHost ); // remove the port part in case it is added. |
|
69 | - return $_sProtocol . '://' . $_sHost . $_sPort . $_SERVER[ 'REQUEST_URI' ]; |
|
68 | + $_sHost = preg_replace( '/:.+/', '', $_sHost ); // remove the port part in case it is added. |
|
69 | + return $_sProtocol.'://'.$_sHost.$_sPort.$_SERVER[ 'REQUEST_URI' ]; |
|
70 | 70 | |
71 | 71 | } |
72 | 72 | /** |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | ? ( string ) $_SERVER[ 'SERVER_PORT' ] |
81 | 81 | : ''; |
82 | 82 | $_aPort = array( |
83 | - 0 => ':' . $_sPort, |
|
83 | + 0 => ':'.$_sPort, |
|
84 | 84 | 1 => '', |
85 | 85 | ); |
86 | - $_bPortSet = ( ! $bSSL && '80' === $_sPort ) || ( $bSSL && '443' === $_sPort ); |
|
86 | + $_bPortSet = ( !$bSSL && '80' === $_sPort ) || ( $bSSL && '443' === $_sPort ); |
|
87 | 87 | return $_aPort[ ( int ) $_bPortSet ]; |
88 | 88 | } |
89 | 89 |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @param array|string $asPrefixes |
37 | 37 | * @retuen void |
38 | 38 | */ |
39 | - public static function cleanTransients( $asPrefixes=array( 'apf' ) ) { |
|
39 | + public static function cleanTransients( $asPrefixes = array( 'apf' ) ) { |
|
40 | 40 | |
41 | 41 | $_aPrefixes = self::getAsArray( $asPrefixes ); |
42 | 42 | if ( self::isNetworkAdmin() ) { |
@@ -46,11 +46,11 @@ discard block |
||
46 | 46 | /** |
47 | 47 | * @var wpdb |
48 | 48 | */ |
49 | - $_oWPDB = $GLOBALS[ 'wpdb' ]; |
|
50 | - foreach( $_aPrefixes as $_sPrefix ) { |
|
49 | + $_oWPDB = $GLOBALS[ 'wpdb' ]; |
|
50 | + foreach ( $_aPrefixes as $_sPrefix ) { |
|
51 | 51 | $_sSQLQuery = "DELETE FROM `{$_oWPDB->options}` " |
52 | 52 | . "WHERE `option_name` " |
53 | - . "LIKE ( '_transient_%{$_sPrefix}%' )"; // this also matches _transient_timeout_{prefix} |
|
53 | + . "LIKE ( '_transient_%{$_sPrefix}%' )"; // this also matches _transient_timeout_{prefix} |
|
54 | 54 | $_oWPDB->query( $_sSQLQuery ); |
55 | 55 | } |
56 | 56 | |
@@ -66,8 +66,8 @@ discard block |
||
66 | 66 | /** |
67 | 67 | * @var wpdb |
68 | 68 | */ |
69 | - $_oWPDB = $GLOBALS[ 'wpdb' ]; |
|
70 | - foreach( $_aPrefixes as $_sPrefix ) { |
|
69 | + $_oWPDB = $GLOBALS[ 'wpdb' ]; |
|
70 | + foreach ( $_aPrefixes as $_sPrefix ) { |
|
71 | 71 | $_sSQLQuery = "DELETE FROM `{$_oWPDB->sitemeta}` " |
72 | 72 | . "WHERE " |
73 | 73 | // this matches _site_transient_timeout_{...} as well |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @return array |
83 | 83 | * @since 3.8.23 |
84 | 84 | */ |
85 | - static public function getTransientAsArray( $sTransientKey, $mDefault=null ) { |
|
85 | + static public function getTransientAsArray( $sTransientKey, $mDefault = null ) { |
|
86 | 86 | return self::getAsArray( |
87 | 87 | self::getTransient( $sTransientKey, $mDefault ) |
88 | 88 | ); |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @return array |
95 | 95 | * @since 3.8.23 |
96 | 96 | */ |
97 | - static public function getTransientWithoutCacheAsArray( $sTransientKey, $mDefault=null ) { |
|
97 | + static public function getTransientWithoutCacheAsArray( $sTransientKey, $mDefault = null ) { |
|
98 | 98 | return self::getAsArray( |
99 | 99 | self::getTransientWithoutCache( $sTransientKey, $mDefault ) |
100 | 100 | ); |
@@ -111,9 +111,9 @@ discard block |
||
111 | 111 | * @sicne 3.8.23 |
112 | 112 | * @return mixed|false `false` on failing to retrieve the transient value. |
113 | 113 | */ |
114 | - static public function getTransientWithoutCache( $sTransientKey, $mDefault=null ) { |
|
114 | + static public function getTransientWithoutCache( $sTransientKey, $mDefault = null ) { |
|
115 | 115 | |
116 | - $sTransientKey = self::_getCompatibleTransientKey( $sTransientKey ); |
|
116 | + $sTransientKey = self::_getCompatibleTransientKey( $sTransientKey ); |
|
117 | 117 | if ( self::isNetworkAdmin() ) { |
118 | 118 | return self::getTransientWithoutCacheForNetwork( $sTransientKey, $mDefault ); |
119 | 119 | } |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | $_mData = $_oWPDB->get_var( |
132 | 132 | $_oWPDB->prepare( |
133 | 133 | $_sSQLQuery, |
134 | - '_transient_' . $sTransientKey, |
|
135 | - '_transient_timeout_' . $sTransientKey |
|
134 | + '_transient_'.$sTransientKey, |
|
135 | + '_transient_timeout_'.$sTransientKey |
|
136 | 136 | ) |
137 | 137 | ); |
138 | 138 | return is_null( $_mData ) ? $mDefault : maybe_unserialize( $_mData ); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | * @since 3.8.23 |
146 | 146 | * @return mixed |
147 | 147 | */ |
148 | - static public function getTransientWithoutCacheForNetwork($sTransientKey, $mDefault ) { |
|
148 | + static public function getTransientWithoutCacheForNetwork( $sTransientKey, $mDefault ) { |
|
149 | 149 | |
150 | 150 | /** |
151 | 151 | * @var wpdb $_oWPDB |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | $_mData = $_oWPDB->get_var( |
162 | 162 | $_oWPDB->prepare( |
163 | 163 | $_sSQLQuery, |
164 | - '_site_transient_' . $sTransientKey, |
|
165 | - '_site_transient_timeout_' . $sTransientKey, |
|
164 | + '_site_transient_'.$sTransientKey, |
|
165 | + '_site_transient_timeout_'.$sTransientKey, |
|
166 | 166 | get_current_network_id() |
167 | 167 | ) |
168 | 168 | ); |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | 0 => 'delete_transient', |
196 | 196 | 1 => 'delete_site_transient', |
197 | 197 | ); |
198 | - $_vTransient = $_aFunctionNames[ ( integer ) self::isNetworkAdmin() ]( $sTransientKey ); |
|
198 | + $_vTransient = $_aFunctionNames[ ( integer ) self::isNetworkAdmin() ]( $sTransientKey ); |
|
199 | 199 | |
200 | 200 | // reset prior value of $_wp_using_ext_object_cache |
201 | 201 | $_wp_using_ext_object_cache = $_bWpUsingExtObjectCacheTemp; |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | * @param mixed $vDefault |
212 | 212 | * @return mixed |
213 | 213 | */ |
214 | - static public function getTransient( $sTransientKey, $vDefault=null ) { |
|
214 | + static public function getTransient( $sTransientKey, $vDefault = null ) { |
|
215 | 215 | |
216 | 216 | // Temporarily disable $_wp_using_ext_object_cache |
217 | 217 | global $_wp_using_ext_object_cache; |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | 0 => 'get_transient', |
224 | 224 | 1 => 'get_site_transient', |
225 | 225 | ); |
226 | - $_vTransient = $_aFunctionNames[ ( integer ) self::isNetworkAdmin() ]( $sTransientKey ); |
|
226 | + $_vTransient = $_aFunctionNames[ ( integer ) self::isNetworkAdmin() ]( $sTransientKey ); |
|
227 | 227 | |
228 | 228 | // Restore the prior value of `$_wp_using_ext_object_cache`. |
229 | 229 | $_wp_using_ext_object_cache = $_bWpUsingExtObjectCacheTemp; |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * @param mixed $vValue |
246 | 246 | * @param integer $iExpiration |
247 | 247 | */ |
248 | - static public function setTransient( $sTransientKey, $vValue, $iExpiration=0 ) { |
|
248 | + static public function setTransient( $sTransientKey, $vValue, $iExpiration = 0 ) { |
|
249 | 249 | |
250 | 250 | // Temporarily disable `$_wp_using_ext_object_cache`. |
251 | 251 | global $_wp_using_ext_object_cache; |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | * @return string |
277 | 277 | * @todo it is said as of WordPress 4.3, it will be 255 since the database table column type becomes VARCHAR(255). |
278 | 278 | */ |
279 | - static public function _getCompatibleTransientKey( $sSubject, $iDeprecated=null ) { |
|
279 | + static public function _getCompatibleTransientKey( $sSubject, $iDeprecated = null ) { |
|
280 | 280 | |
281 | 281 | $_iAllowedCharacterLength = isset( $iDeprecated ) |
282 | 282 | ? $iDeprecated |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | 0, // start position |
295 | 295 | $_iPrefixLengthToKeep - 1 // how many characters to extract |
296 | 296 | ); |
297 | - return $_sPrefixToKeep . '_' . md5( $sSubject ); |
|
297 | + return $_sPrefixToKeep.'_'.md5( $sSubject ); |
|
298 | 298 | |
299 | 299 | } |
300 | 300 | |
@@ -309,7 +309,7 @@ discard block |
||
309 | 309 | * @param array $aAdditionalOptions an additional options array to merge with the options array. |
310 | 310 | * @return mixed |
311 | 311 | */ |
312 | - static public function getOption( $sOptionKey, $asKey=null, $vDefault=null, array $aAdditionalOptions=array() ) { |
|
312 | + static public function getOption( $sOptionKey, $asKey = null, $vDefault = null, array $aAdditionalOptions = array() ) { |
|
313 | 313 | return self::_getOptionByFunctionName( $sOptionKey, $asKey, $vDefault, $aAdditionalOptions ); |
314 | 314 | } |
315 | 315 | /** |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | * @remark Used in the network admin area. |
325 | 325 | * @return mixed |
326 | 326 | */ |
327 | - static public function getSiteOption( $sOptionKey, $asKey=null, $vDefault=null, array $aAdditionalOptions=array() ) { |
|
327 | + static public function getSiteOption( $sOptionKey, $asKey = null, $vDefault = null, array $aAdditionalOptions = array() ) { |
|
328 | 328 | return self::_getOptionByFunctionName( $sOptionKey, $asKey, $vDefault, $aAdditionalOptions, 'get_site_option' ); |
329 | 329 | } |
330 | 330 | |
@@ -340,16 +340,16 @@ discard block |
||
340 | 340 | * @return mixed |
341 | 341 | * @since 3.5.3 |
342 | 342 | */ |
343 | - static private function _getOptionByFunctionName( $sOptionKey, $asKey=null, $vDefault=null, array $aAdditionalOptions=array(), $sFunctionName='get_option' ) { |
|
343 | + static private function _getOptionByFunctionName( $sOptionKey, $asKey = null, $vDefault = null, array $aAdditionalOptions = array(), $sFunctionName = 'get_option' ) { |
|
344 | 344 | |
345 | 345 | // Entire options |
346 | - if ( ! isset( $asKey ) ) { |
|
346 | + if ( !isset( $asKey ) ) { |
|
347 | 347 | $_aOptions = $sFunctionName( |
348 | 348 | $sOptionKey, |
349 | 349 | isset( $vDefault ) |
350 | 350 | ? $vDefault |
351 | 351 | : array() |
352 | - );; |
|
352 | + ); ; |
|
353 | 353 | return empty( $aAdditionalOptions ) |
354 | 354 | ? $_aOptions |
355 | 355 | : self::uniteArrays( |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function get() { |
43 | 43 | |
44 | - foreach( $this->_getFormattedDimensionalKeys( $this->aFieldAddresses ) as $_sFlatFieldAddress ) { |
|
44 | + foreach ( $this->_getFormattedDimensionalKeys( $this->aFieldAddresses ) as $_sFlatFieldAddress ) { |
|
45 | 45 | |
46 | 46 | $_aDimensionalKeys = explode( '|', $_sFlatFieldAddress ); |
47 | 47 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | // If the retrieved value does not exist, null will be given. |
54 | 54 | // This occurs with page meta boxes. |
55 | - if ( ! is_array( $_aDynamicElements ) ) { |
|
55 | + if ( !is_array( $_aDynamicElements ) ) { |
|
56 | 56 | continue; |
57 | 57 | } |
58 | 58 |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | * @since 3.5.4 Added the `$aHeader` parameter. Deprecated the `$sFileName` parameter as it is included in the $aHeader definition. |
100 | 100 | * @since 2.0.0 |
101 | 101 | */ |
102 | - public function doExport( $vData, $sFormatType=null, array $aHeader=array() ) { |
|
102 | + public function doExport( $vData, $sFormatType = null, array $aHeader = array() ) { |
|
103 | 103 | |
104 | - $sFormatType = isset( $sFormatType ) |
|
104 | + $sFormatType = isset( $sFormatType ) |
|
105 | 105 | ? $sFormatType |
106 | 106 | : $this->sFormatType; |
107 | 107 | |
@@ -129,9 +129,9 @@ discard block |
||
129 | 129 | * @param string $sKey |
130 | 130 | * @return void |
131 | 131 | */ |
132 | - private function _outputHTTPHeader( array $aHeader, $sKey='' ) { |
|
132 | + private function _outputHTTPHeader( array $aHeader, $sKey = '' ) { |
|
133 | 133 | |
134 | - foreach( $aHeader as $_sKey => $_asValue ) { |
|
134 | + foreach ( $aHeader as $_sKey => $_asValue ) { |
|
135 | 135 | |
136 | 136 | // Nested items. Set the key to overrider array keys. |
137 | 137 | if ( is_array( $_asValue ) ) { |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | return; |
174 | 174 | case 'json': // for json. |
175 | 175 | echo json_encode( ( array ) $vData ); |
176 | - return ; |
|
176 | + return; |
|
177 | 177 | case 'array': // for serialized PHP array. |
178 | 178 | default: // for anything else, |
179 | 179 | echo serialize( ( array ) $vData ); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | * Stores method names of the `WP_Widget` class, referred when the class is assumed as a WP_Widget subclass. |
116 | 116 | * @since 3.8.17 |
117 | 117 | */ |
118 | - public $aWPWidgetMethods = array(); |
|
118 | + public $aWPWidgetMethods = array(); |
|
119 | 119 | /** |
120 | 120 | * Stores property names of the `WP_Widget` class, , referred when the class is assumed as a WP_Widget subclass. |
121 | 121 | * @since 3.8.17 |
@@ -126,13 +126,13 @@ discard block |
||
126 | 126 | * Sets up properties. |
127 | 127 | * @since 3.7.0 |
128 | 128 | */ |
129 | - public function __construct( $oCaller, $sCallerPath, $sClassName, $sCapability='manage_options', $sTextDomain='admin-page-framework', $sStructureType='' ) { |
|
129 | + public function __construct( $oCaller, $sCallerPath, $sClassName, $sCapability = 'manage_options', $sTextDomain = 'admin-page-framework', $sStructureType = '' ) { |
|
130 | 130 | |
131 | 131 | // 3.7.0+ |
132 | - $this->_sFormRegistrationHook = 'load_' . $sClassName; |
|
132 | + $this->_sFormRegistrationHook = 'load_'.$sClassName; |
|
133 | 133 | |
134 | 134 | // 3.7.9+ - setting a custom action hook for admin notices prevents the form object from being instantiated unnecessarily. |
135 | - $this->sSettingNoticeActionHook = 'load_' . $sClassName; |
|
135 | + $this->sSettingNoticeActionHook = 'load_'.$sClassName; |
|
136 | 136 | |
137 | 137 | parent::__construct( |
138 | 138 | $oCaller, |
@@ -35,10 +35,10 @@ discard block |
||
35 | 35 | * @since 3.8.4 When non-true value is passed, `0px` will be returned. |
36 | 36 | * @return string |
37 | 37 | */ |
38 | - static public function getLengthSanitized( $sLength, $sUnit='px' ) { |
|
38 | + static public function getLengthSanitized( $sLength, $sUnit = 'px' ) { |
|
39 | 39 | $sLength = $sLength ? $sLength : 0; |
40 | 40 | return is_numeric( $sLength ) |
41 | - ? $sLength . $sUnit |
|
41 | + ? $sLength.$sUnit |
|
42 | 42 | : $sLength; |
43 | 43 | } |
44 | 44 | |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | * @since 3.8.11 Renamed from `fixNumber()`. |
81 | 81 | * @return string|integer A numeric value will be returned. |
82 | 82 | */ |
83 | - static public function getNumberFixed( $nToFix, $nDefault, $nMin='', $nMax='' ) { |
|
83 | + static public function getNumberFixed( $nToFix, $nDefault, $nMin = '', $nMax = '' ) { |
|
84 | 84 | |
85 | - if ( ! is_numeric( trim( $nToFix ) ) ) { |
|
85 | + if ( !is_numeric( trim( $nToFix ) ) ) { |
|
86 | 86 | return $nDefault; |
87 | 87 | } |
88 | 88 | if ( $nMin !== '' && $nToFix < $nMin ) { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @return string|integer A numeric value will be returned. |
101 | 101 | * @deprecated 3.8.11 |
102 | 102 | */ |
103 | - static public function fixNumber( $nToFix, $nDefault, $nMin='', $nMax='' ) { |
|
103 | + static public function fixNumber( $nToFix, $nDefault, $nMin = '', $nMax = '' ) { |
|
104 | 104 | return self::getNumberFixed( $nToFix, $nDefault, $nMin, $nMax ); |
105 | 105 | } |
106 | 106 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | static public function getCSSMinified( $sCSSRules ) { |
115 | 115 | return str_replace( |
116 | - array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' '), // remove line breaks, tab, and white sspaces. |
|
116 | + array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' ' ), // remove line breaks, tab, and white sspaces. |
|
117 | 117 | '', |
118 | 118 | preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $sCSSRules ) // remove comments |
119 | 119 | ); |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | */ |
151 | 151 | static public function getNumberOfReadableSize( $nSize ) { |
152 | 152 | |
153 | - $_nReturn = substr( $nSize, 0, -1 ); |
|
154 | - switch( strtoupper( substr( $nSize, -1 ) ) ) { |
|
153 | + $_nReturn = substr( $nSize, 0, -1 ); |
|
154 | + switch ( strtoupper( substr( $nSize, -1 ) ) ) { |
|
155 | 155 | case 'P': |
156 | 156 | $_nReturn *= 1024; |
157 | 157 | case 'T': |
@@ -175,13 +175,13 @@ discard block |
||
175 | 175 | * @since 3.8.26 Added the `$iRoundPrecision` parameter. |
176 | 176 | * @return string |
177 | 177 | */ |
178 | - static public function getReadableBytes( $nBytes, $iRoundPrecision=2 ) { |
|
178 | + static public function getReadableBytes( $nBytes, $iRoundPrecision = 2 ) { |
|
179 | 179 | $_aUnits = array( 0 => 'B', 1 => 'kB', 2 => 'MB', 3 => 'GB' ); |
180 | 180 | $_nLog = log( $nBytes, 1024 ); |
181 | 181 | $_iPower = ( int ) $_nLog; |
182 | 182 | $_ifSize = pow( 1024, $_nLog - $_iPower ); |
183 | 183 | $_ifSize = round( $_ifSize, $iRoundPrecision ); |
184 | - return $_ifSize . $_aUnits[ $_iPower ]; |
|
184 | + return $_ifSize.$_aUnits[ $_iPower ]; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function __construct( $oProp, $oMsg ) { |
29 | 29 | |
30 | - if ( ! $this->_shouldProceed( $oProp ) ) { |
|
30 | + if ( !$this->_shouldProceed( $oProp ) ) { |
|
31 | 31 | return; |
32 | 32 | } |
33 | 33 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | private function _shouldProceed( $oProp ) { |
46 | 46 | |
47 | - if ( $oProp->bIsAdminAjax || ! $oProp->bIsAdmin ) { |
|
47 | + if ( $oProp->bIsAdminAjax || !$oProp->bIsAdmin ) { |
|
48 | 48 | return false; |
49 | 49 | } |
50 | 50 | return ( boolean ) $oProp->bShowDebugInfo; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public function _replyToGetPageLoadInfo( $sFooterHTML ) { |
72 | 72 | |
73 | 73 | // 3.8.8+ The `bShowDebugInfo` property may be updated by the user during the page load. |
74 | - if ( ! $this->oProp->bShowDebugInfo ) { |
|
74 | + if ( !$this->oProp->bShowDebugInfo ) { |
|
75 | 75 | return $sFooterHTML; |
76 | 76 | } |
77 | 77 | |
@@ -105,10 +105,10 @@ discard block |
||
105 | 105 | $_sInitialMemoryUsage = $this->getReadableBytes( $_nInitialMemoryUsage ); |
106 | 106 | return "<div id='admin-page-framework-page-load-stats'>" |
107 | 107 | . "<ul>" |
108 | - . "<li>" . sprintf( $this->oMsg->get( 'queries_in_seconds' ), $_nQueryCount, $_nSeconds ) . "</li>" |
|
109 | - . "<li>" . sprintf( $this->oMsg->get( 'out_of_x_memory_used' ), $_sMemoryUsage, $_sMemoryLimit, round( ( $_nMemoryUsage / $_nMemoryLimit ), 2 ) * 100 . '%' ) . "</li>" |
|
110 | - . "<li>" . sprintf( $this->oMsg->get( 'peak_memory_usage' ), $_sMemoryPeakUsage ) . "</li>" |
|
111 | - . "<li>" . sprintf( $this->oMsg->get( 'initial_memory_usage' ), $_sInitialMemoryUsage ) . "</li>" |
|
108 | + . "<li>".sprintf( $this->oMsg->get( 'queries_in_seconds' ), $_nQueryCount, $_nSeconds )."</li>" |
|
109 | + . "<li>".sprintf( $this->oMsg->get( 'out_of_x_memory_used' ), $_sMemoryUsage, $_sMemoryLimit, round( ( $_nMemoryUsage / $_nMemoryLimit ), 2 ) * 100.'%' )."</li>" |
|
110 | + . "<li>".sprintf( $this->oMsg->get( 'peak_memory_usage' ), $_sMemoryPeakUsage )."</li>" |
|
111 | + . "<li>".sprintf( $this->oMsg->get( 'initial_memory_usage' ), $_sInitialMemoryUsage )."</li>" |
|
112 | 112 | . "</ul>" |
113 | 113 | . "</div>"; |
114 | 114 |
@@ -180,24 +180,24 @@ discard block |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
183 | - * Removes the given section(s) by section ID. |
|
184 | - * |
|
185 | - * This accesses the property storing the added section arrays and removes the specified ones. |
|
186 | - * |
|
187 | - * <h4>Example</h4> |
|
188 | - * <code>$this->removeSettingSections( 'text_fields', 'selectors', 'another_section', 'yet_another_section' ); |
|
189 | - * </code> |
|
190 | - * |
|
191 | - * @since 2.0.0 |
|
192 | - * @since 3.0.0 Changed the scope to public from protected. |
|
193 | - * @since 3.5.3 Removed the parameter declarations as they are caught with the func_get_args(). |
|
194 | - * @access public |
|
195 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
196 | - * @param string $sSectionID1 the section ID to remove. |
|
197 | - * @param string $sSectionID2 (optional) another section ID to remove. |
|
198 | - * @param string $_and_more (optional) add more section IDs to the next parameters as many as necessary. |
|
199 | - * @return void |
|
200 | - */ |
|
183 | + * Removes the given section(s) by section ID. |
|
184 | + * |
|
185 | + * This accesses the property storing the added section arrays and removes the specified ones. |
|
186 | + * |
|
187 | + * <h4>Example</h4> |
|
188 | + * <code>$this->removeSettingSections( 'text_fields', 'selectors', 'another_section', 'yet_another_section' ); |
|
189 | + * </code> |
|
190 | + * |
|
191 | + * @since 2.0.0 |
|
192 | + * @since 3.0.0 Changed the scope to public from protected. |
|
193 | + * @since 3.5.3 Removed the parameter declarations as they are caught with the func_get_args(). |
|
194 | + * @access public |
|
195 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
196 | + * @param string $sSectionID1 the section ID to remove. |
|
197 | + * @param string $sSectionID2 (optional) another section ID to remove. |
|
198 | + * @param string $_and_more (optional) add more section IDs to the next parameters as many as necessary. |
|
199 | + * @return void |
|
200 | + */ |
|
201 | 201 | public function removeSettingSections( /* $sSectionID1=null, $sSectionID2=null, $_and_more=null */ ) { |
202 | 202 | foreach( func_get_args() as $_sSectionID ) { |
203 | 203 | $this->oForm->removeSection( $_sSectionID ); |
@@ -262,38 +262,38 @@ discard block |
||
262 | 262 | } |
263 | 263 | } |
264 | 264 | /** |
265 | - * Adds the given field array items into the field array property. |
|
266 | - * |
|
267 | - * Identical to the `addSettingFields()` method except that this method does not accept enumerated parameters. |
|
268 | - * |
|
269 | - * @since 2.1.2 |
|
270 | - * @since 3.0.0 Changed the scope to public from protected. |
|
271 | - * @access public |
|
272 | - * @param array|string $asField the field array or the target section ID. If the target section ID is set, the section_id key can be omitted from the next passing field array. |
|
273 | - * @return void |
|
274 | - */ |
|
265 | + * Adds the given field array items into the field array property. |
|
266 | + * |
|
267 | + * Identical to the `addSettingFields()` method except that this method does not accept enumerated parameters. |
|
268 | + * |
|
269 | + * @since 2.1.2 |
|
270 | + * @since 3.0.0 Changed the scope to public from protected. |
|
271 | + * @access public |
|
272 | + * @param array|string $asField the field array or the target section ID. If the target section ID is set, the section_id key can be omitted from the next passing field array. |
|
273 | + * @return void |
|
274 | + */ |
|
275 | 275 | public function addSettingField( $asField ) { |
276 | 276 | $this->oForm->addField( $asField ); |
277 | 277 | } |
278 | 278 | |
279 | 279 | /** |
280 | - * Removes the given field(s) by field ID. |
|
281 | - * |
|
282 | - * This accesses the property storing the added field arrays and removes the specified ones. |
|
283 | - * |
|
284 | - * <h4>Example</h4> |
|
285 | - * <code>$this->removeSettingFields( 'fieldID_A', 'fieldID_B', 'fieldID_C', 'fieldID_D' ); |
|
286 | - * </code> |
|
287 | - * |
|
288 | - * @since 2.0.0 |
|
289 | - * @since 3.0.0 Changed the scope to public from protected. |
|
290 | - * @access public |
|
291 | - * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
292 | - * @param string $sFieldID1 the field ID to remove. |
|
293 | - * @param string $sFieldID2 (optional) another field ID to remove. |
|
294 | - * @param string $_and_more (optional) add more field IDs to the next parameters as many as necessary. |
|
295 | - * @return void |
|
296 | - */ |
|
280 | + * Removes the given field(s) by field ID. |
|
281 | + * |
|
282 | + * This accesses the property storing the added field arrays and removes the specified ones. |
|
283 | + * |
|
284 | + * <h4>Example</h4> |
|
285 | + * <code>$this->removeSettingFields( 'fieldID_A', 'fieldID_B', 'fieldID_C', 'fieldID_D' ); |
|
286 | + * </code> |
|
287 | + * |
|
288 | + * @since 2.0.0 |
|
289 | + * @since 3.0.0 Changed the scope to public from protected. |
|
290 | + * @access public |
|
291 | + * @remark Accepts variadic parameters; the number of accepted parameters are not limited to three. |
|
292 | + * @param string $sFieldID1 the field ID to remove. |
|
293 | + * @param string $sFieldID2 (optional) another field ID to remove. |
|
294 | + * @param string $_and_more (optional) add more field IDs to the next parameters as many as necessary. |
|
295 | + * @return void |
|
296 | + */ |
|
297 | 297 | public function removeSettingFields( $sFieldID1, $sFieldID2=null, $_and_more=null ) { |
298 | 298 | foreach( func_get_args() as $_sFieldID ) { |
299 | 299 | $this->oForm->removeField( $_sFieldID ); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function addSettingSections( /* $aSection1, $aSection2=null, $_and_more=null */ ) { |
86 | 86 | |
87 | - foreach( func_get_args() as $asSection ) { |
|
87 | + foreach ( func_get_args() as $asSection ) { |
|
88 | 88 | $this->addSettingSection( $asSection ); |
89 | 89 | } |
90 | 90 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function addSettingSection( $asSection ) { |
109 | 109 | |
110 | - if ( ! is_array( $asSection ) ) { |
|
110 | + if ( !is_array( $asSection ) ) { |
|
111 | 111 | $this->_sTargetPageSlug = is_string( $asSection ) |
112 | 112 | ? $asSection |
113 | 113 | : $this->_sTargetPageSlug; |
@@ -129,10 +129,10 @@ discard block |
||
129 | 129 | ) |
130 | 130 | ); |
131 | 131 | |
132 | - $aSection[ 'section_tab_slug' ] = $this->oUtil->sanitizeSlug( $aSection[ 'section_tab_slug' ] ); |
|
132 | + $aSection[ 'section_tab_slug' ] = $this->oUtil->sanitizeSlug( $aSection[ 'section_tab_slug' ] ); |
|
133 | 133 | |
134 | 134 | // A page slug is required. |
135 | - if ( ! $aSection[ 'page_slug' ] ) { |
|
135 | + if ( !$aSection[ 'page_slug' ] ) { |
|
136 | 136 | return; |
137 | 137 | } |
138 | 138 | $this->oForm->addSection( $aSection ); |
@@ -148,8 +148,8 @@ discard block |
||
148 | 148 | private function _getTargetPageSlug( $aSection ) { |
149 | 149 | |
150 | 150 | $_sTargetPageSlug = $this->oUtil->getElement( |
151 | - $aSection, // subject |
|
152 | - 'page_slug', // key |
|
151 | + $aSection, // subject |
|
152 | + 'page_slug', // key |
|
153 | 153 | $this->_sTargetPageSlug // default |
154 | 154 | ); |
155 | 155 | |
@@ -169,8 +169,8 @@ discard block |
||
169 | 169 | */ |
170 | 170 | private function _getTargetTabSlug( $aSection ) { |
171 | 171 | $_sTargetTabSlug = $this->oUtil->getElement( |
172 | - $aSection, // subject |
|
173 | - 'tab_slug', // key |
|
172 | + $aSection, // subject |
|
173 | + 'tab_slug', // key |
|
174 | 174 | $this->_sTargetTabSlug // default |
175 | 175 | ); |
176 | 176 | $_sTargetTabSlug = $_sTargetTabSlug |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | * @return void |
200 | 200 | */ |
201 | 201 | public function removeSettingSections( /* $sSectionID1=null, $sSectionID2=null, $_and_more=null */ ) { |
202 | - foreach( func_get_args() as $_sSectionID ) { |
|
202 | + foreach ( func_get_args() as $_sSectionID ) { |
|
203 | 203 | $this->oForm->removeSection( $_sSectionID ); |
204 | 204 | } |
205 | 205 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | * @remark The actual registration will be performed in the <em>_replyToRegisterSettings()</em> method with the <em>admin_menu</em> hook. |
258 | 258 | */ |
259 | 259 | public function addSettingFields( /* $aField1, $aField2=null, $_and_more=null */ ) { |
260 | - foreach( func_get_args() as $aField ) { |
|
260 | + foreach ( func_get_args() as $aField ) { |
|
261 | 261 | $this->addSettingField( $aField ); |
262 | 262 | } |
263 | 263 | } |
@@ -294,8 +294,8 @@ discard block |
||
294 | 294 | * @param string $_and_more (optional) add more field IDs to the next parameters as many as necessary. |
295 | 295 | * @return void |
296 | 296 | */ |
297 | - public function removeSettingFields( $sFieldID1, $sFieldID2=null, $_and_more=null ) { |
|
298 | - foreach( func_get_args() as $_sFieldID ) { |
|
297 | + public function removeSettingFields( $sFieldID1, $sFieldID2 = null, $_and_more = null ) { |
|
298 | + foreach ( func_get_args() as $_sFieldID ) { |
|
299 | 299 | $this->oForm->removeField( $_sFieldID ); |
300 | 300 | } |
301 | 301 | } |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | $this->oProp->sOptionKey, |
343 | 343 | empty( $_aParams ) |
344 | 344 | ? null // will return the entire options array |
345 | - : $_aDimensionalKeys, // dimensional keys |
|
345 | + : $_aDimensionalKeys, // dimensional keys |
|
346 | 346 | $_mDefault, // default |
347 | 347 | $this->getSavedOptions() + $this->oForm->getDefaultFormValues() |
348 | 348 | ); |
@@ -361,21 +361,21 @@ discard block |
||
361 | 361 | * If the user has not submitted the form, the framework will try to return the default value set in the field definition array. |
362 | 362 | * @deprecated 3.3.0 |
363 | 363 | */ |
364 | - public function getFieldValue( $sFieldID, $sSectionID='' ) { |
|
364 | + public function getFieldValue( $sFieldID, $sSectionID = '' ) { |
|
365 | 365 | |
366 | 366 | $this->oUtil->showDeprecationNotice( |
367 | - 'The method,' . __METHOD__ . ',', // deprecated item |
|
367 | + 'The method,'.__METHOD__.',', // deprecated item |
|
368 | 368 | 'getValue()' // alternative |
369 | 369 | ); |
370 | 370 | |
371 | 371 | $_aOptions = $this->oUtil->uniteArrays( $this->oProp->aOptions, $this->oForm->getDefaultFormValues() ); |
372 | 372 | /* If it's saved, return it */ |
373 | - if ( ! $sSectionID ) { |
|
373 | + if ( !$sSectionID ) { |
|
374 | 374 | if ( array_key_exists( $sFieldID, $_aOptions ) ) { |
375 | 375 | return $_aOptions[ $sFieldID ]; |
376 | 376 | } |
377 | 377 | // loop through section elements |
378 | - foreach( $_aOptions as $aOptions ) { |
|
378 | + foreach ( $_aOptions as $aOptions ) { |
|
379 | 379 | if ( array_key_exists( $sFieldID, $aOptions ) ) { |
380 | 380 | return $aOptions[ $sFieldID ]; |
381 | 381 | } |