@@ -410,7 +410,7 @@ |
||
410 | 410 | * This is used for element that `label_min_width` is applied. |
411 | 411 | * |
412 | 412 | * @param array $aField |
413 | - * @param array|string $asClassAttributes |
|
413 | + * @param string $asClassAttributes |
|
414 | 414 | * @param array $aAttributes |
415 | 415 | * @return string |
416 | 416 | * @since 3.8.0 |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | 'after_label' => null, |
60 | 60 | 'before_field' => null, |
61 | 61 | 'after_field' => null, |
62 | - 'label_min_width' => '', // (string|integer) min-width applied to the input label in pixels. 3.8.0+ Changed the default value from 140 to 0 as it is now applied via embedded CSS. When this value is set by the user, it is set inline and the value will be overridden. [3.8.4+] Changed the value from `0` to `''`. |
|
62 | + 'label_min_width' => '', // (string|integer) min-width applied to the input label in pixels. 3.8.0+ Changed the default value from 140 to 0 as it is now applied via embedded CSS. When this value is set by the user, it is set inline and the value will be overridden. [3.8.4+] Changed the value from `0` to `''`. |
|
63 | 63 | 'before_fieldset' => null, // 3.1.1+ |
64 | 64 | 'after_fieldset' => null, // 3.1.1+ |
65 | 65 | |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @param object $oMsg The framework message object. |
100 | 100 | * @param boolean $bAutoRegister Whether or not to register the field type(s). |
101 | 101 | */ |
102 | - public function __construct( $asClassName='admin_page_framework', $asFieldTypeSlug=null, $oMsg=null, $bAutoRegister=true ) { |
|
102 | + public function __construct( $asClassName = 'admin_page_framework', $asFieldTypeSlug = null, $oMsg = null, $bAutoRegister = true ) { |
|
103 | 103 | |
104 | 104 | $this->aFieldTypeSlugs = empty( $asFieldTypeSlug ) |
105 | 105 | ? $this->aFieldTypeSlugs |
@@ -110,9 +110,9 @@ discard block |
||
110 | 110 | |
111 | 111 | // This automatically registers the field type. The build-in ones will be registered manually so it will be skipped. |
112 | 112 | if ( $bAutoRegister ) { |
113 | - foreach( ( array ) $asClassName as $_sClassName ) { |
|
113 | + foreach ( ( array ) $asClassName as $_sClassName ) { |
|
114 | 114 | add_filter( |
115 | - 'field_types_' . $_sClassName, |
|
115 | + 'field_types_'.$_sClassName, |
|
116 | 116 | array( $this, '_replyToRegisterInputFieldType' ) |
117 | 117 | ); |
118 | 118 | } |
@@ -161,8 +161,8 @@ discard block |
||
161 | 161 | } |
162 | 162 | return is_array( $asLabel ) // if the user sets multiple items |
163 | 163 | ? $this->getElement( |
164 | - $asElement, // subject |
|
165 | - $this->getAsArray( $asKey, true /* preserve empty */ ), // dimensional path |
|
164 | + $asElement, // subject |
|
165 | + $this->getAsArray( $asKey, true /* preserve empty */ ), // dimensional path |
|
166 | 166 | '' // default - if the element is not found, return an empty |
167 | 167 | ) |
168 | 168 | : $asElement; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | */ |
179 | 179 | protected function getFieldOutput( array $aFieldset ) { |
180 | 180 | |
181 | - if ( ! is_object( $aFieldset[ '_caller_object' ] ) ) { |
|
181 | + if ( !is_object( $aFieldset[ '_caller_object' ] ) ) { |
|
182 | 182 | return ''; |
183 | 183 | } |
184 | 184 | |
@@ -186,14 +186,14 @@ discard block |
||
186 | 186 | $aFieldset[ '_parent_field_object' ] = $aFieldset[ '_field_object' ]; // 3.6.0+ |
187 | 187 | |
188 | 188 | // 3.7.0+ The caller object is no longer a factory object but a form object. |
189 | - $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
189 | + $_oCallerForm = $aFieldset[ '_caller_object' ]; |
|
190 | 190 | |
191 | 191 | $_oFieldset = new AdminPageFramework_Form_View___Fieldset( |
192 | - $aFieldset, // the field definition array |
|
193 | - $_oCallerForm->aSavedData, // the stored form data |
|
194 | - $_oCallerForm->getFieldErrors(), // the field error array. |
|
195 | - $_oCallerForm->aFieldTypeDefinitions, // the field type definition array. |
|
196 | - $_oCallerForm->oMsg, // the system message object |
|
192 | + $aFieldset, // the field definition array |
|
193 | + $_oCallerForm->aSavedData, // the stored form data |
|
194 | + $_oCallerForm->getFieldErrors(), // the field error array. |
|
195 | + $_oCallerForm->aFieldTypeDefinitions, // the field type definition array. |
|
196 | + $_oCallerForm->oMsg, // the system message object |
|
197 | 197 | $_oCallerForm->aCallbacks // field output element callables. |
198 | 198 | ); |
199 | 199 | return $_oFieldset->get(); |
@@ -237,13 +237,13 @@ discard block |
||
237 | 237 | * @return array |
238 | 238 | * @internal |
239 | 239 | */ |
240 | - public function getDefinitionArray( $sFieldTypeSlug='' ) { |
|
240 | + public function getDefinitionArray( $sFieldTypeSlug = '' ) { |
|
241 | 241 | |
242 | 242 | // The uniteArrays() method resulted in somewhat being slow due to overhead on checking array keys for recursive array merges. |
243 | 243 | $_aDefaultKeys = $this->aDefaultKeys + self::$_aDefaultKeys; |
244 | - $_aDefaultKeys['attributes'] = isset( $this->aDefaultKeys['attributes'] ) && is_array( $this->aDefaultKeys['attributes'] ) |
|
245 | - ? $this->aDefaultKeys['attributes'] + self::$_aDefaultKeys['attributes'] |
|
246 | - : self::$_aDefaultKeys['attributes']; |
|
244 | + $_aDefaultKeys[ 'attributes' ] = isset( $this->aDefaultKeys[ 'attributes' ] ) && is_array( $this->aDefaultKeys[ 'attributes' ] ) |
|
245 | + ? $this->aDefaultKeys[ 'attributes' ] + self::$_aDefaultKeys[ 'attributes' ] |
|
246 | + : self::$_aDefaultKeys[ 'attributes' ]; |
|
247 | 247 | |
248 | 248 | return array( |
249 | 249 | 'sFieldTypeSlug' => $sFieldTypeSlug, |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | * @param string $sFieldSetType |
290 | 290 | * @internal |
291 | 291 | */ |
292 | - public function _replyToFieldTypeSetter( $sFieldSetType='' ) { |
|
292 | + public function _replyToFieldTypeSetter( $sFieldSetType = '' ) { |
|
293 | 293 | $this->_sFieldSetType = $sFieldSetType; |
294 | 294 | } |
295 | 295 | |
@@ -344,8 +344,8 @@ discard block |
||
344 | 344 | wp_enqueue_script( 'media-upload' ); |
345 | 345 | } |
346 | 346 | |
347 | - if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) { |
|
348 | - add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ) , 1, 2 ); |
|
347 | + if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php',) ) ) { |
|
348 | + add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ), 1, 2 ); |
|
349 | 349 | } |
350 | 350 | |
351 | 351 | } |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | public function _replyToReplaceThickBoxText( $sTranslated, $sText ) { |
364 | 364 | |
365 | 365 | // Replace the button label in the media thick box. |
366 | - if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
366 | + if ( !in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
367 | 367 | return $sTranslated; |
368 | 368 | } |
369 | 369 | if ( $sText !== 'Insert into Post' ) { |
@@ -394,10 +394,10 @@ discard block |
||
394 | 394 | */ |
395 | 395 | public function _replyToRemovingMediaLibraryTab( $aTabs ) { |
396 | 396 | |
397 | - if ( ! isset( $_REQUEST[ 'enable_external_source' ] ) ) { |
|
397 | + if ( !isset( $_REQUEST[ 'enable_external_source' ] ) ) { |
|
398 | 398 | return $aTabs; |
399 | 399 | } |
400 | - if ( ! ( boolean ) $_REQUEST[ 'enable_external_source' ] ) { |
|
400 | + if ( !( boolean ) $_REQUEST[ 'enable_external_source' ] ) { |
|
401 | 401 | unset( $aTabs[ 'type_url' ] ); // removes the 'From URL' tab in the thick box. |
402 | 402 | } |
403 | 403 | return $aTabs; |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | * @return string |
416 | 416 | * @since 3.8.0 |
417 | 417 | */ |
418 | - protected function getLabelContainerAttributes( $aField, $asClassAttributes, array $aAttributes=array() ) { |
|
418 | + protected function getLabelContainerAttributes( $aField, $asClassAttributes, array $aAttributes = array() ) { |
|
419 | 419 | |
420 | 420 | $aAttributes[ 'class' ] = $this->getClassAttribute( $asClassAttributes, $this->getElement( $aAttributes, 'class' ) ); |
421 | 421 | $aAttributes[ 'style' ] = $this->getStyleAttribute( |
@@ -337,14 +337,14 @@ discard block |
||
337 | 337 | wp_enqueue_script( 'thickbox' ); |
338 | 338 | wp_enqueue_style( 'thickbox' ); |
339 | 339 | |
340 | - if ( function_exists( 'wp_enqueue_media' ) ) { |
|
340 | + if ( function_exists( 'wp_enqueue_media' ) ) { |
|
341 | 341 | // If the WordPress version is 3.5 or above, |
342 | 342 | new AdminPageFramework_Form_View___Script_MediaUploader( $this->oMsg ); |
343 | 343 | } else { |
344 | 344 | wp_enqueue_script( 'media-upload' ); |
345 | 345 | } |
346 | 346 | |
347 | - if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) { |
|
347 | + if ( in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php', ) ) ) { |
|
348 | 348 | add_filter( 'gettext', array( $this, '_replyToReplaceThickBoxText' ) , 1, 2 ); |
349 | 349 | } |
350 | 350 | |
@@ -363,13 +363,13 @@ discard block |
||
363 | 363 | public function _replyToReplaceThickBoxText( $sTranslated, $sText ) { |
364 | 364 | |
365 | 365 | // Replace the button label in the media thick box. |
366 | - if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
366 | + if ( ! in_array( $this->getPageNow(), array( 'media-upload.php', 'async-upload.php' ) ) ) { |
|
367 | 367 | return $sTranslated; |
368 | 368 | } |
369 | - if ( $sText !== 'Insert into Post' ) { |
|
369 | + if ( $sText !== 'Insert into Post' ) { |
|
370 | 370 | return $sTranslated; |
371 | 371 | } |
372 | - if ( $this->getQueryValueInURLByKey( wp_get_referer(), 'referrer' ) !== 'admin_page_framework' ) { |
|
372 | + if ( $this->getQueryValueInURLByKey( wp_get_referer(), 'referrer' ) !== 'admin_page_framework' ) { |
|
373 | 373 | return $sTranslated; |
374 | 374 | } |
375 | 375 |
@@ -432,8 +432,8 @@ |
||
432 | 432 | /** |
433 | 433 | * |
434 | 434 | * @since 3.5.12 |
435 | - * @param array|string|null $asCategories |
|
436 | - * @param array|string|null $asRemovingCategories |
|
435 | + * @param string|null $asCategories |
|
436 | + * @param string $asRemovingCategories |
|
437 | 437 | * @return string|array |
438 | 438 | * @internal |
439 | 439 | */ |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * </code> |
73 | 73 | * @var array |
74 | 74 | */ |
75 | - public $aFieldTypeSlugs = array( 'system', ); |
|
75 | + public $aFieldTypeSlugs = array( 'system',); |
|
76 | 76 | |
77 | 77 | /** |
78 | 78 | * Defines the default key-values of this field type. |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | * @remark `$_aDefaultKeys` holds shared default key-values defined in the base class. |
93 | 93 | */ |
94 | 94 | protected $aDefaultKeys = array( |
95 | - 'data' => array(), // [3.2.0+] Stores the data to be displayed |
|
96 | - 'print_type' => 1, // [3.4.6+] 1: readable representation of array. 2: print_r() |
|
95 | + 'data' => array(), // [3.2.0+] Stores the data to be displayed |
|
96 | + 'print_type' => 1, // [3.4.6+] 1: readable representation of array. 2: print_r() |
|
97 | 97 | 'attributes' => array( |
98 | 98 | 'rows' => 60, |
99 | 99 | 'autofocus' => null, |
@@ -233,13 +233,13 @@ discard block |
||
233 | 233 | . "<div class='admin-page-framework-input-label-container'>" |
234 | 234 | . "<label for='{$aField[ 'input_id' ]}'>" |
235 | 235 | . $aField[ 'before_input' ] |
236 | - . ( $aField[ 'label' ] && ! $aField[ 'repeatable' ] |
|
237 | - ? "<span " . $this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ) . ">" |
|
236 | + . ( $aField[ 'label' ] && !$aField[ 'repeatable' ] |
|
237 | + ? "<span ".$this->getLabelContainerAttributes( $aField, 'admin-page-framework-input-label-string' ).">" |
|
238 | 238 | . $aField[ 'label' ] |
239 | 239 | . "</span>" |
240 | 240 | : "" |
241 | 241 | ) |
242 | - . "<textarea " . $this->getAttributes( $_aInputAttributes ) . " >" |
|
242 | + . "<textarea ".$this->getAttributes( $_aInputAttributes )." >" |
|
243 | 243 | . esc_textarea( $this->___getSystemInformation( $aField[ 'value' ], $aField[ 'data' ], $aField[ 'print_type' ] ) ) |
244 | 244 | . "</textarea>" |
245 | 245 | . $aField[ 'after_input' ] |
@@ -257,15 +257,15 @@ discard block |
||
257 | 257 | * @param integer $iPrintType |
258 | 258 | * @internal |
259 | 259 | */ |
260 | - private function ___getSystemInformation( $asValue=null, $asCustomData=null, $iPrintType=1 ) { |
|
260 | + private function ___getSystemInformation( $asValue = null, $asCustomData = null, $iPrintType = 1 ) { |
|
261 | 261 | |
262 | 262 | if ( isset( $asValue ) ) { |
263 | 263 | return $asValue; |
264 | 264 | } |
265 | 265 | |
266 | - $_aOutput = array(); |
|
267 | - foreach( $this->___getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) { |
|
268 | - $_aOutput[] = $this->_____getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType ); |
|
266 | + $_aOutput = array(); |
|
267 | + foreach ( $this->___getFormattedSystemInformation( $asCustomData ) as $_sSection => $_aInfo ) { |
|
268 | + $_aOutput[ ] = $this->_____getSystemInfoBySection( $_sSection, $_aInfo, $iPrintType ); |
|
269 | 269 | } |
270 | 270 | return implode( PHP_EOL, $_aOutput ); |
271 | 271 | |
@@ -281,15 +281,15 @@ discard block |
||
281 | 281 | |
282 | 282 | $_aData = $this->getAsArray( $asCustomData ); |
283 | 283 | $_aData = $_aData + array( |
284 | - 'WordPress' => $this->___getSiteInfoWithCache( ! isset( $_aData[ 'WordPress' ] ) ), |
|
285 | - 'PHP' => $this->_getPHPInfo( ! isset( $_aData[ 'PHP' ] ) ), |
|
286 | - 'PHP Error Log' => $this->___getErrorLogByType( 'php', ! isset( $_aData[ 'PHP Error Log' ] ) ), |
|
284 | + 'WordPress' => $this->___getSiteInfoWithCache( !isset( $_aData[ 'WordPress' ] ) ), |
|
285 | + 'PHP' => $this->_getPHPInfo( !isset( $_aData[ 'PHP' ] ) ), |
|
286 | + 'PHP Error Log' => $this->___getErrorLogByType( 'php', !isset( $_aData[ 'PHP Error Log' ] ) ), |
|
287 | 287 | 'MySQL' => isset( $_aData[ 'MySQL' ] ) |
288 | 288 | ? null |
289 | - : $this->getMySQLInfo(), // defined in the utility class. |
|
290 | - 'MySQL Error Log' => $this->___getErrorLogByType( 'mysql', ! isset( $_aData[ 'MySQL Error Log' ] ) ), |
|
291 | - 'Server' => $this->___getWebServerInfo( ! isset( $_aData[ 'Server' ] ) ), |
|
292 | - 'Browser' => $this->___getClientInfo( ! isset( $_aData[ 'Browser' ] ) ), |
|
289 | + : $this->getMySQLInfo(), // defined in the utility class. |
|
290 | + 'MySQL Error Log' => $this->___getErrorLogByType( 'mysql', !isset( $_aData[ 'MySQL Error Log' ] ) ), |
|
291 | + 'Server' => $this->___getWebServerInfo( !isset( $_aData[ 'Server' ] ) ), |
|
292 | + 'Browser' => $this->___getClientInfo( !isset( $_aData[ 'Browser' ] ) ), |
|
293 | 293 | 'Admin Page Framework' => isset( $_aData[ 'Admin Page Framework' ] ) |
294 | 294 | ? null |
295 | 295 | : AdminPageFramework_Registry::getInfo(), |
@@ -312,10 +312,10 @@ discard block |
||
312 | 312 | switch ( $iPrintType ) { |
313 | 313 | default: |
314 | 314 | case 1: // use the framework readable representation of arrays. |
315 | - return $this->getReadableArrayContents( $sSectionName, $aData, 32 ) . PHP_EOL; |
|
315 | + return $this->getReadableArrayContents( $sSectionName, $aData, 32 ).PHP_EOL; |
|
316 | 316 | case 2: // use print_r() |
317 | - return "[{$sSectionName}]" . PHP_EOL |
|
318 | - . print_r( $aData, true ) . PHP_EOL; |
|
317 | + return "[{$sSectionName}]".PHP_EOL |
|
318 | + . print_r( $aData, true ).PHP_EOL; |
|
319 | 319 | } |
320 | 320 | } |
321 | 321 | /** |
@@ -327,9 +327,9 @@ discard block |
||
327 | 327 | * @param boolean $bGenerateInfo |
328 | 328 | * @return string |
329 | 329 | */ |
330 | - private function ___getClientInfo( $bGenerateInfo=true ) { |
|
330 | + private function ___getClientInfo( $bGenerateInfo = true ) { |
|
331 | 331 | |
332 | - if ( ! $bGenerateInfo ) { |
|
332 | + if ( !$bGenerateInfo ) { |
|
333 | 333 | return ''; |
334 | 334 | } |
335 | 335 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $_aBrowser = @ini_get( 'browscap' ) |
338 | 338 | ? get_browser( $_SERVER[ 'HTTP_USER_AGENT' ], true ) |
339 | 339 | : array(); |
340 | - unset( $_aBrowser[ 'browser_name_regex' ] ); // this element causes output to be blank |
|
340 | + unset( $_aBrowser[ 'browser_name_regex' ] ); // this element causes output to be blank |
|
341 | 341 | return empty( $_aBrowser ) |
342 | 342 | ? __( 'No browser information found.', 'admin-page-framework' ) |
343 | 343 | : $_aBrowser; |
@@ -353,9 +353,9 @@ discard block |
||
353 | 353 | * @param string $sType The error log type. Either 'php' or 'mysql' is accepted. |
354 | 354 | * @param boolean $bGenerateInfo Whether to generate a log. This is for the caller method to reduce a conditinal statement. |
355 | 355 | */ |
356 | - private function ___getErrorLogByType( $sType, $bGenerateInfo=true ) { |
|
356 | + private function ___getErrorLogByType( $sType, $bGenerateInfo = true ) { |
|
357 | 357 | |
358 | - if ( ! $bGenerateInfo ) { |
|
358 | + if ( !$bGenerateInfo ) { |
|
359 | 359 | return ''; |
360 | 360 | } |
361 | 361 | switch ( $sType ) { |
@@ -388,9 +388,9 @@ discard block |
||
388 | 388 | * @param boolean $bGenerateInfo |
389 | 389 | * @return array The generated site information array. |
390 | 390 | */ |
391 | - private function ___getSiteInfoWithCache( $bGenerateInfo=true ) { |
|
391 | + private function ___getSiteInfoWithCache( $bGenerateInfo = true ) { |
|
392 | 392 | |
393 | - if ( ! $bGenerateInfo || isset( self::$_aSiteInfo ) ) { |
|
393 | + if ( !$bGenerateInfo || isset( self::$_aSiteInfo ) ) { |
|
394 | 394 | return self::$_aSiteInfo; |
395 | 395 | } |
396 | 396 | self::$_aSiteInfo = self::___getSiteInfo(); |
@@ -424,8 +424,8 @@ discard block |
||
424 | 424 | 'wp_remote_get()' => $this->___getWPRemoteGetStatus(), |
425 | 425 | __( 'Multibite String Extension', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'mb_detect_encoding' ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ), |
426 | 426 | __( 'WP_CONTENT_DIR Writeable', 'admin-page-framework' ) => $this->getAOrB( is_writable( WP_CONTENT_DIR ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
427 | - __( 'Active Plugins', 'admin-page-framework' ) => PHP_EOL . $this->___getActivePlugins(), |
|
428 | - __( 'Network Active Plugins', 'admin-page-framework' ) => PHP_EOL . $this->___getNetworkActivePlugins(), |
|
427 | + __( 'Active Plugins', 'admin-page-framework' ) => PHP_EOL.$this->___getActivePlugins(), |
|
428 | + __( 'Network Active Plugins', 'admin-page-framework' ) => PHP_EOL.$this->___getNetworkActivePlugins(), |
|
429 | 429 | __( 'Constants', 'admin-page-framework' ) => $this->___getDefinedConstants( 'user' ), |
430 | 430 | ); |
431 | 431 | } |
@@ -437,9 +437,9 @@ discard block |
||
437 | 437 | * @return string|array |
438 | 438 | * @internal |
439 | 439 | */ |
440 | - private function ___getDefinedConstants( $asCategories=null, $asRemovingCategories=null ) { |
|
440 | + private function ___getDefinedConstants( $asCategories = null, $asRemovingCategories = null ) { |
|
441 | 441 | $_asConstants = $this->getDefinedConstants( $asCategories, $asRemovingCategories ); |
442 | - if ( ! is_array( $_asConstants ) ) { |
|
442 | + if ( !is_array( $_asConstants ) ) { |
|
443 | 443 | return $_asConstants; |
444 | 444 | } |
445 | 445 | if ( isset( $_asConstants[ 'user' ] ) ) { |
@@ -476,12 +476,12 @@ discard block |
||
476 | 476 | |
477 | 477 | // If the WordPress version is less than 3.4, |
478 | 478 | if ( version_compare( $GLOBALS[ 'wp_version' ], '3.4', '<' ) ) { |
479 | - $_aThemeData = get_theme_data( get_stylesheet_directory() . '/style.css' ); |
|
480 | - return $_aThemeData[ 'Name' ] . ' ' . $_aThemeData[ 'Version' ]; |
|
479 | + $_aThemeData = get_theme_data( get_stylesheet_directory().'/style.css' ); |
|
480 | + return $_aThemeData[ 'Name' ].' '.$_aThemeData[ 'Version' ]; |
|
481 | 481 | } |
482 | 482 | |
483 | 483 | $_oThemeData = wp_get_theme(); |
484 | - return $_oThemeData->Name . ' ' . $_oThemeData->Version; |
|
484 | + return $_oThemeData->Name.' '.$_oThemeData->Version; |
|
485 | 485 | |
486 | 486 | } |
487 | 487 | /** |
@@ -495,10 +495,10 @@ discard block |
||
495 | 495 | $_aPluginList = array(); |
496 | 496 | $_aActivePlugins = get_option( 'active_plugins', array() ); |
497 | 497 | foreach ( get_plugins() as $_sPluginPath => $_aPlugin ) { |
498 | - if ( ! in_array( $_sPluginPath, $_aActivePlugins ) ) { |
|
498 | + if ( !in_array( $_sPluginPath, $_aActivePlugins ) ) { |
|
499 | 499 | continue; |
500 | 500 | } |
501 | - $_aPluginList[] = ' ' . $_aPlugin[ 'Name' ] . ': ' . $_aPlugin[ 'Version' ]; |
|
501 | + $_aPluginList[ ] = ' '.$_aPlugin[ 'Name' ].': '.$_aPlugin[ 'Version' ]; |
|
502 | 502 | } |
503 | 503 | return implode( PHP_EOL, $_aPluginList ); |
504 | 504 | |
@@ -510,17 +510,17 @@ discard block |
||
510 | 510 | */ |
511 | 511 | private function ___getNetworkActivePlugins() { |
512 | 512 | |
513 | - if ( ! is_multisite() ) { |
|
513 | + if ( !is_multisite() ) { |
|
514 | 514 | return ''; |
515 | 515 | } |
516 | 516 | $_aPluginList = array(); |
517 | 517 | $_aActivePlugins = get_site_option( 'active_sitewide_plugins', array() ); |
518 | 518 | foreach ( wp_get_active_network_plugins() as $_sPluginPath ) { |
519 | - if ( ! array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) { |
|
519 | + if ( !array_key_exists( plugin_basename( $_sPluginPath ), $_aActivePlugins ) ) { |
|
520 | 520 | continue; |
521 | 521 | } |
522 | 522 | $_aPlugin = get_plugin_data( $_sPluginPath ); |
523 | - $_aPluginList[] = ' ' . $_aPlugin[ 'Name' ] . ' :' . $_aPlugin[ 'Version' ]; |
|
523 | + $_aPluginList[ ] = ' '.$_aPlugin[ 'Name' ].' :'.$_aPlugin[ 'Version' ]; |
|
524 | 524 | } |
525 | 525 | return implode( PHP_EOL, $_aPluginList ); |
526 | 526 | |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | if ( is_wp_error( $aoResponse ) ) { |
585 | 585 | return true; |
586 | 586 | } |
587 | - if ( $aoResponse[ 'response'][ 'code' ] < 200 ) { |
|
587 | + if ( $aoResponse[ 'response' ][ 'code' ] < 200 ) { |
|
588 | 588 | return true; |
589 | 589 | } |
590 | 590 | if ( $aoResponse[ 'response' ][ 'code' ] >= 300 ) { |
@@ -610,13 +610,13 @@ discard block |
||
610 | 610 | * @param boolean $bGenerateInfo |
611 | 611 | * @return array |
612 | 612 | */ |
613 | - private function _getPHPInfo( $bGenerateInfo=true ) { |
|
613 | + private function _getPHPInfo( $bGenerateInfo = true ) { |
|
614 | 614 | |
615 | - if ( ! $bGenerateInfo || isset( self::$_aPHPInfo ) ) { |
|
615 | + if ( !$bGenerateInfo || isset( self::$_aPHPInfo ) ) { |
|
616 | 616 | return self::$_aPHPInfo; |
617 | 617 | } |
618 | 618 | |
619 | - $_oErrorReporting = new AdminPageFramework_ErrorReporting; |
|
619 | + $_oErrorReporting = new AdminPageFramework_ErrorReporting; |
|
620 | 620 | self::$_aPHPInfo = array( |
621 | 621 | __( 'Version', 'admin-page-framework' ) => phpversion(), |
622 | 622 | __( 'Safe Mode', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'safe_mode' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
@@ -627,16 +627,16 @@ discard block |
||
627 | 627 | __( 'Max Execution Time', 'admin-page-framework' ) => @ini_get( 'max_execution_time' ), |
628 | 628 | __( 'Max Input Vars', 'admin-page-framework' ) => @ini_get( 'max_input_vars' ), |
629 | 629 | __( 'Argument Separator', 'admin-page-framework' ) => @ini_get( 'arg_separator.output' ), |
630 | - __( 'Allow URL File Open', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'allow_url_fopen' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
|
631 | - __( 'Display Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'display_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
632 | - __( 'Log Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'log_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
630 | + __( 'Allow URL File Open', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'allow_url_fopen' ), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
|
631 | + __( 'Display Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'display_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
632 | + __( 'Log Errors', 'admin-page-framework' ) => $this->getAOrB( @ini_get( 'log_errors' ), $this->oMsg->get( 'on' ), $this->oMsg->get( 'off' ) ), |
|
633 | 633 | __( 'Error log location', 'admin-page-framework' ) => @ini_get( 'error_log' ), |
634 | 634 | __( 'Error Reporting Level', 'admin-page-framework' ) => $_oErrorReporting->getErrorLevel(), |
635 | - __( 'FSOCKOPEN', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'fsockopen' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
636 | - __( 'cURL', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'curl_init' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
637 | - __( 'SOAP', 'admin-page-framework' ) => $this->getAOrB( class_exists( 'SoapClient' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
638 | - __( 'SUHOSIN', 'admin-page-framework' ) => $this->getAOrB( extension_loaded( 'suhosin' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
639 | - 'ini_set()' => $this->getAOrB( function_exists( 'ini_set' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
635 | + __( 'FSOCKOPEN', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'fsockopen' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
636 | + __( 'cURL', 'admin-page-framework' ) => $this->getAOrB( function_exists( 'curl_init' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
637 | + __( 'SOAP', 'admin-page-framework' ) => $this->getAOrB( class_exists( 'SoapClient' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
638 | + __( 'SUHOSIN', 'admin-page-framework' ) => $this->getAOrB( extension_loaded( 'suhosin' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
639 | + 'ini_set()' => $this->getAOrB( function_exists( 'ini_set' ), $this->oMsg->get( 'supported' ), $this->oMsg->get( 'not_supported' ) ), |
|
640 | 640 | ) |
641 | 641 | + $this->getPHPInfo() |
642 | 642 | + array( |
@@ -656,10 +656,10 @@ discard block |
||
656 | 656 | * @param boolean $bGenerateInfo |
657 | 657 | * @return array|string |
658 | 658 | */ |
659 | - private function ___getWebServerInfo( $bGenerateInfo=true ) { |
|
659 | + private function ___getWebServerInfo( $bGenerateInfo = true ) { |
|
660 | 660 | return $bGenerateInfo |
661 | 661 | ? array( |
662 | - __( 'Web Server', 'admin-page-framework' ) => $_SERVER['SERVER_SOFTWARE'], |
|
662 | + __( 'Web Server', 'admin-page-framework' ) => $_SERVER[ 'SERVER_SOFTWARE' ], |
|
663 | 663 | 'SSL' => $this->getAOrB( is_ssl(), $this->oMsg->get( 'yes' ), $this->oMsg->get( 'no' ) ), |
664 | 664 | __( 'Session', 'admin-page-framework' ) => $this->getAOrB( isset( $_SESSION ), $this->oMsg->get( 'enabled' ), $this->oMsg->get( 'disabled' ) ), |
665 | 665 | __( 'Session Name', 'admin-page-framework' ) => esc_html( @ini_get( 'session.name' ) ), |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | */ |
17 | 17 | class AdminPageFrameworkLoader_Registry_Base { |
18 | 18 | |
19 | - const VERSION = '3.8.24'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
19 | + const VERSION = '3.8.24'; // <--- DON'T FORGET TO CHANGE THIS AS WELL!! |
|
20 | 20 | const NAME = 'Admin Page Framework - Loader'; // the name is not 'Admin Page Framework' because warning messages gets confusing. |
21 | - const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc. |
|
21 | + const SHORTNAME = 'Admin Page Framework'; // used for a menu title etc. |
|
22 | 22 | const DESCRIPTION = 'Loads Admin Page Framework which facilitates WordPress plugin and theme development.'; |
23 | 23 | const URI = 'http://admin-page-framework.michaeluno.jp/'; |
24 | 24 | const AUTHOR = 'miunosoft (Michael Uno)'; |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | * @remark This is also accessed from `uninstall.php` so do not remove. |
56 | 56 | * @remark Do not exceed 8 characters as a transient name allows 45 characters or less ( 40 for site transients ) so that md5 (32 characters) can be added. |
57 | 57 | */ |
58 | - const TRANSIENT_PREFIX = 'APFL_'; |
|
58 | + const TRANSIENT_PREFIX = 'APFL_'; |
|
59 | 59 | |
60 | 60 | /** |
61 | 61 | * The hook slug used for the prefix of action and filter hook names. |
62 | 62 | * |
63 | 63 | * @remark The ending underscore is not necessary. |
64 | 64 | */ |
65 | - const HOOK_SLUG = 'admin_page_framework_loader'; |
|
65 | + const HOOK_SLUG = 'admin_page_framework_loader'; |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * The text domain slug and its path. |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | */ |
117 | 117 | static public $aAdminPages = array( |
118 | 118 | // key => 'page slug' |
119 | - 'about' => 'apfl_about', // the welcome page |
|
119 | + 'about' => 'apfl_about', // the welcome page |
|
120 | 120 | 'addon' => 'apfl_addons', |
121 | 121 | 'tool' => 'apfl_tools', |
122 | 122 | 'help' => 'apfl_contact', |
@@ -154,12 +154,12 @@ discard block |
||
154 | 154 | * @since 3.5.0 |
155 | 155 | * @return string |
156 | 156 | */ |
157 | - public static function getPluginURL( $sRelativePath='' ) { |
|
157 | + public static function getPluginURL( $sRelativePath = '' ) { |
|
158 | 158 | if ( isset( self::$_sPluginURLCache ) ) { |
159 | - return self::$_sPluginURLCache . $sRelativePath; |
|
159 | + return self::$_sPluginURLCache.$sRelativePath; |
|
160 | 160 | } |
161 | 161 | self::$_sPluginURLCache = trailingslashit( plugins_url( '', self::$sFilePath ) ); |
162 | - return self::$_sPluginURLCache . $sRelativePath; |
|
162 | + return self::$_sPluginURLCache.$sRelativePath; |
|
163 | 163 | } |
164 | 164 | /** |
165 | 165 | * @since 3.7.9 |
@@ -189,13 +189,13 @@ discard block |
||
189 | 189 | * @since 3.5.0 |
190 | 190 | * @return void |
191 | 191 | */ |
192 | - static public function setAdminNotice( $sMessage, $sClassAttribute='error' ) { |
|
193 | - if ( ! is_admin() ) { |
|
192 | + static public function setAdminNotice( $sMessage, $sClassAttribute = 'error' ) { |
|
193 | + if ( !is_admin() ) { |
|
194 | 194 | return; |
195 | 195 | } |
196 | - self::$_aAdminNotices[] = array( |
|
196 | + self::$_aAdminNotices[ ] = array( |
|
197 | 197 | 'message' => $sMessage, |
198 | - 'class_attribute' => trim( $sClassAttribute ) . ' notice is-dismissible', |
|
198 | + 'class_attribute' => trim( $sClassAttribute ).' notice is-dismissible', |
|
199 | 199 | ); |
200 | 200 | add_action( 'admin_notices', array( __CLASS__, '_replyToSetAdminNotice' ) ); |
201 | 201 | } |
@@ -205,12 +205,12 @@ discard block |
||
205 | 205 | * @return void |
206 | 206 | */ |
207 | 207 | static public function _replyToSetAdminNotice() { |
208 | - foreach( self::$_aAdminNotices as $_aAdminNotice ) { |
|
209 | - echo "<div class='" . esc_attr( $_aAdminNotice['class_attribute'] ) . " notice is-dismissible'>" |
|
208 | + foreach ( self::$_aAdminNotices as $_aAdminNotice ) { |
|
209 | + echo "<div class='".esc_attr( $_aAdminNotice[ 'class_attribute' ] )." notice is-dismissible'>" |
|
210 | 210 | ."<p>" |
211 | 211 | . sprintf( |
212 | - '<strong>%1$s</strong>: ' . $_aAdminNotice['message'], |
|
213 | - self::NAME . ' ' . self::VERSION |
|
212 | + '<strong>%1$s</strong>: '.$_aAdminNotice[ 'message' ], |
|
213 | + self::NAME.' '.self::VERSION |
|
214 | 214 | ) |
215 | 215 | . "</p>" |
216 | 216 | . "</div>"; |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | AdminPageFrameworkLoader_Registry::setUp( __FILE__ ); |
223 | 223 | |
224 | 224 | // Initial checks. - Do no load if accessed directly, not exiting because the 'uninstall.php' and inclusion list generator will load this file. |
225 | -if ( ! defined( 'ABSPATH' ) ) { |
|
225 | +if ( !defined( 'ABSPATH' ) ) { |
|
226 | 226 | return; |
227 | 227 | } |
228 | 228 | if ( defined( 'DOING_UNINSTALL' ) && DOING_UNINSTALL ) { |
@@ -234,8 +234,8 @@ discard block |
||
234 | 234 | |
235 | 235 | $_bFrameworkLoaded = class_exists( 'AdminPageFramework_Registry', false ); |
236 | 236 | if ( |
237 | - ! $_bFrameworkLoaded |
|
238 | - || ! defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
237 | + !$_bFrameworkLoaded |
|
238 | + || !defined( 'AdminPageFramework_Registry::VERSION' ) // backward compatibility |
|
239 | 239 | || version_compare( AdminPageFramework_Registry::VERSION, AdminPageFrameworkLoader_Registry::VERSION, '<' ) |
240 | 240 | ) { |
241 | 241 | AdminPageFrameworkLoader_Registry::setAdminNotice( |
@@ -253,18 +253,18 @@ discard block |
||
253 | 253 | add_action( 'admin_init', 'AdminPageFrameworkLoader_Warning' ); |
254 | 254 | |
255 | 255 | // Include the library file - the development version will be available if you cloned the GitHub repository. |
256 | -$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath . '/development/admin-page-framework.php'; |
|
256 | +$_sDevelopmentVersionPath = AdminPageFrameworkLoader_Registry::$sDirPath.'/development/admin-page-framework.php'; |
|
257 | 257 | $_bDebugMode = defined( 'WP_DEBUG' ) && WP_DEBUG; |
258 | 258 | $_bLoadDevelopmentVersion = $_bDebugMode && file_exists( $_sDevelopmentVersionPath ); |
259 | 259 | include( |
260 | 260 | $_bLoadDevelopmentVersion |
261 | 261 | ? $_sDevelopmentVersionPath |
262 | - : AdminPageFrameworkLoader_Registry::$sDirPath . '/library/apf/admin-page-framework.php' |
|
262 | + : AdminPageFrameworkLoader_Registry::$sDirPath.'/library/apf/admin-page-framework.php' |
|
263 | 263 | ); |
264 | 264 | |
265 | 265 | // Include the framework loader plugin components. |
266 | 266 | include( AdminPageFramework_Registry::$aClassFiles[ 'AdminPageFramework_PluginBootstrap' ] ); |
267 | -include( AdminPageFrameworkLoader_Registry::$sDirPath . '/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
267 | +include( AdminPageFrameworkLoader_Registry::$sDirPath.'/include/class/AdminPageFrameworkLoader_Bootstrap.php' ); |
|
268 | 268 | new AdminPageFrameworkLoader_Bootstrap( |
269 | 269 | AdminPageFrameworkLoader_Registry::$sFilePath, |
270 | 270 | AdminPageFrameworkLoader_Registry::HOOK_SLUG // hook prefix |
@@ -28,12 +28,12 @@ discard block |
||
28 | 28 | * @param string $sTextDomain |
29 | 29 | * @since 3.7.9 |
30 | 30 | */ |
31 | - public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID=array( 'post' ), $sContext='normal', $sPriority='default', $sCapability='edit_posts', $sTextDomain='admin-page-framework' ) { |
|
31 | + public function __construct( $sMetaBoxID, $sTitle, $asPostTypeOrScreenID = array( 'post' ), $sContext = 'normal', $sPriority = 'default', $sCapability = 'edit_posts', $sTextDomain = 'admin-page-framework' ) { |
|
32 | 32 | |
33 | 33 | // This is important to set the hooks before the parent constructor |
34 | 34 | // as the setUp wil be called in there if the default action hook (current_screen) is already triggered. |
35 | - add_action( 'set_up_' . $this->oProp->sClassName, array( $this, '_replyToSetUpHooks' ) ); |
|
36 | - add_action( 'set_up_' . $this->oProp->sClassName, array( $this, '_replyToSetUpValidationHooks' ) ); |
|
35 | + add_action( 'set_up_'.$this->oProp->sClassName, array( $this, '_replyToSetUpHooks' ) ); |
|
36 | + add_action( 'set_up_'.$this->oProp->sClassName, array( $this, '_replyToSetUpValidationHooks' ) ); |
|
37 | 37 | |
38 | 38 | parent::__construct( |
39 | 39 | $sMetaBoxID, |
@@ -115,14 +115,14 @@ discard block |
||
115 | 115 | * @callback add_meta_boxes |
116 | 116 | */ |
117 | 117 | public function _replyToRegisterMetaBoxes() { |
118 | - foreach( $this->oProp->aPostTypes as $_sPostType ) { |
|
118 | + foreach ( $this->oProp->aPostTypes as $_sPostType ) { |
|
119 | 119 | add_meta_box( |
120 | - $this->oProp->sMetaBoxID, // id |
|
121 | - $this->oProp->sTitle, // title |
|
120 | + $this->oProp->sMetaBoxID, // id |
|
121 | + $this->oProp->sTitle, // title |
|
122 | 122 | array( $this, '_replyToPrintMetaBoxContents' ), // callback |
123 | - $_sPostType, // post type |
|
124 | - $this->oProp->sContext, // context |
|
125 | - $this->oProp->sPriority, // priority |
|
123 | + $_sPostType, // post type |
|
124 | + $this->oProp->sContext, // context |
|
125 | + $this->oProp->sPriority, // priority |
|
126 | 126 | null // argument - deprecated $this->oForm->aFields |
127 | 127 | ); |
128 | 128 | } |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | * @internal |
155 | 155 | * @return integer The found post ID. `0` if not found. |
156 | 156 | */ |
157 | - private function ___getPostID() { |
|
157 | + private function ___getPostID() { |
|
158 | 158 | |
159 | 159 | // for an editing post page. |
160 | 160 | if ( isset( $GLOBALS[ 'post' ]->ID ) ) { |
@@ -186,14 +186,14 @@ discard block |
||
186 | 186 | public function _replyToFilterSavingData( $aPostData, $aUnmodified ) { |
187 | 187 | |
188 | 188 | // Perform initial checks. |
189 | - if ( ! $this->_shouldProceedValidation( $aUnmodified ) ) { |
|
189 | + if ( !$this->_shouldProceedValidation( $aUnmodified ) ) { |
|
190 | 190 | return $aPostData; |
191 | 191 | } |
192 | 192 | |
193 | 193 | // Retrieve the submitted data. |
194 | - $_aInputs = $this->oForm->getSubmittedData( |
|
195 | - $_POST, // subject data to be parsed. Will be sanitized in the method |
|
196 | - true, // extract data with the fieldset structure |
|
194 | + $_aInputs = $this->oForm->getSubmittedData( |
|
195 | + $_POST, // subject data to be parsed. Will be sanitized in the method |
|
196 | + true, // extract data with the fieldset structure |
|
197 | 197 | false // strip slashes |
198 | 198 | ); |
199 | 199 | $_aInputsRaw = $_aInputs; // store one for the last input array. |
@@ -228,8 +228,8 @@ discard block |
||
228 | 228 | } |
229 | 229 | |
230 | 230 | $this->oForm->updateMetaDataByType( |
231 | - $_iPostID, // object id |
|
232 | - $_aInputs, // user submit form data |
|
231 | + $_iPostID, // object id |
|
232 | + $_aInputs, // user submit form data |
|
233 | 233 | $this->oForm->dropRepeatableElements( $_aSavedMeta ), // Drop repeatable section elements from the saved meta array. |
234 | 234 | $this->oForm->sStructureType // fields type |
235 | 235 | ); |
@@ -288,14 +288,14 @@ discard block |
||
288 | 288 | } |
289 | 289 | |
290 | 290 | // If our nonce isn't there, or we can't verify it, bail |
291 | - if ( ! isset( $_POST[ $this->oProp->sMetaBoxID ] ) ) { |
|
291 | + if ( !isset( $_POST[ $this->oProp->sMetaBoxID ] ) ) { |
|
292 | 292 | return false; |
293 | 293 | } |
294 | - if ( ! wp_verify_nonce( $_POST[ $this->oProp->sMetaBoxID ], $this->oProp->sMetaBoxID ) ) { |
|
294 | + if ( !wp_verify_nonce( $_POST[ $this->oProp->sMetaBoxID ], $this->oProp->sMetaBoxID ) ) { |
|
295 | 295 | return false; |
296 | 296 | } |
297 | 297 | |
298 | - if ( ! in_array( $aUnmodified[ 'post_type' ], $this->oProp->aPostTypes, true ) ) { |
|
298 | + if ( !in_array( $aUnmodified[ 'post_type' ], $this->oProp->aPostTypes, true ) ) { |
|
299 | 299 | return false; |
300 | 300 | } |
301 | 301 |
@@ -154,7 +154,7 @@ |
||
154 | 154 | * @internal |
155 | 155 | * @return integer The found post ID. `0` if not found. |
156 | 156 | */ |
157 | - private function ___getPostID() { |
|
157 | + private function ___getPostID() { |
|
158 | 158 | |
159 | 159 | // for an editing post page. |
160 | 160 | if ( isset( $GLOBALS[ 'post' ]->ID ) ) { |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | * @since 2.1.5 |
30 | 30 | * @internal |
31 | 31 | */ |
32 | - public function _enqueueStyles( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
32 | + public function _enqueueStyles( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
33 | 33 | |
34 | 34 | $_aHandleIDs = array(); |
35 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
36 | - $_aHandleIDs[] = $this->_enqueueStyle( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
35 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
36 | + $_aHandleIDs[ ] = $this->_enqueueStyle( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
37 | 37 | } |
38 | 38 | return $_aHandleIDs; |
39 | 39 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
58 | 58 | * @internal |
59 | 59 | */ |
60 | - public function _enqueueStyle( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
60 | + public function _enqueueStyle( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
61 | 61 | |
62 | 62 | $sSRC = trim( $sSRC ); |
63 | 63 | if ( empty( $sSRC ) ) { return ''; } |
@@ -73,13 +73,13 @@ discard block |
||
73 | 73 | 'sSRC' => $sSRC, |
74 | 74 | 'aPostTypes' => empty( $aPostTypes ) ? $this->oProp->aPostTypes : $aPostTypes, |
75 | 75 | 'sType' => 'style', |
76 | - 'handle_id' => 'style_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedStyleIndex ), |
|
76 | + 'handle_id' => 'style_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedStyleIndex ), |
|
77 | 77 | ), |
78 | 78 | self::$_aStructure_EnqueuingResources |
79 | 79 | ); |
80 | 80 | |
81 | 81 | // Store the attributes in another container by url. |
82 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ]['attributes']; |
|
82 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'attributes' ]; |
|
83 | 83 | |
84 | 84 | return $this->oProp->aEnqueuingStyles[ $_sSRCHash ][ 'handle_id' ]; |
85 | 85 | |
@@ -91,11 +91,11 @@ discard block |
||
91 | 91 | * @since 2.1.5 |
92 | 92 | * @internal |
93 | 93 | */ |
94 | - public function _enqueueScripts( $aSRCs, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
94 | + public function _enqueueScripts( $aSRCs, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
95 | 95 | |
96 | 96 | $_aHandleIDs = array(); |
97 | - foreach( ( array ) $aSRCs as $_sSRC ) { |
|
98 | - $_aHandleIDs[] = $this->_enqueueScript( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
97 | + foreach ( ( array ) $aSRCs as $_sSRC ) { |
|
98 | + $_aHandleIDs[ ] = $this->_enqueueScript( $_sSRC, $aPostTypes, $aCustomArgs ); |
|
99 | 99 | } |
100 | 100 | return $_aHandleIDs; |
101 | 101 | |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | * @return string The script handle ID. If the passed url is not a valid url string, an empty string will be returned. |
121 | 121 | * @internal |
122 | 122 | */ |
123 | - public function _enqueueScript( $sSRC, $aPostTypes=array(), $aCustomArgs=array() ) { |
|
123 | + public function _enqueueScript( $sSRC, $aPostTypes = array(), $aCustomArgs = array() ) { |
|
124 | 124 | |
125 | - $sSRC = trim( $sSRC ); |
|
125 | + $sSRC = trim( $sSRC ); |
|
126 | 126 | if ( empty( $sSRC ) ) { |
127 | 127 | return ''; |
128 | 128 | } |
@@ -140,13 +140,13 @@ discard block |
||
140 | 140 | 'sSRC' => $sSRC, |
141 | 141 | 'aPostTypes' => empty( $aPostTypes ) ? $this->oProp->aPostTypes : $aPostTypes, |
142 | 142 | 'sType' => 'script', |
143 | - 'handle_id' => 'script_' . $this->oProp->sClassName . '_' . ( ++$this->oProp->iEnqueuedScriptIndex ), |
|
143 | + 'handle_id' => 'script_'.$this->oProp->sClassName.'_'.( ++$this->oProp->iEnqueuedScriptIndex ), |
|
144 | 144 | ), |
145 | 145 | self::$_aStructure_EnqueuingResources |
146 | 146 | ); |
147 | 147 | |
148 | 148 | // Store the attributes in another container by url. |
149 | - $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['handle_id'] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ]['attributes']; |
|
149 | + $this->oProp->aResourceAttributes[ $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ] ] = $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'attributes' ]; |
|
150 | 150 | |
151 | 151 | return $this->oProp->aEnqueuingScripts[ $_sSRCHash ][ 'handle_id' ]; |
152 | 152 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | * @since 3.0.0 |
159 | 159 | * @internal |
160 | 160 | */ |
161 | - public function _forceToEnqueueStyle( $sSRC, $aCustomArgs=array() ) { |
|
161 | + public function _forceToEnqueueStyle( $sSRC, $aCustomArgs = array() ) { |
|
162 | 162 | return $this->_enqueueStyle( $sSRC, array(), $aCustomArgs ); |
163 | 163 | } |
164 | 164 | /** |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | * @since 3.0.0 |
168 | 168 | * @internal |
169 | 169 | */ |
170 | - public function _forceToEnqueueScript( $sSRC, $aCustomArgs=array() ) { |
|
170 | + public function _forceToEnqueueScript( $sSRC, $aCustomArgs = array() ) { |
|
171 | 171 | return $this->_enqueueScript( $sSRC, array(), $aCustomArgs ); |
172 | 172 | } |
173 | 173 |
@@ -37,10 +37,10 @@ discard block |
||
37 | 37 | * @return string |
38 | 38 | * @since 3.8.9 |
39 | 39 | */ |
40 | - static protected function _getLegibleDetails( $mValue, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) { |
|
40 | + static protected function _getLegibleDetails( $mValue, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) { |
|
41 | 41 | if ( is_array( $mValue ) ) { |
42 | - return '(array, length: ' . count( $mValue ).') ' |
|
43 | - . print_r( self::___getLegibleDetailedArray( $mValue, $iStringLengthLimit, $iArrayDepthLimit ) , true ); |
|
42 | + return '(array, length: '.count( $mValue ).') ' |
|
43 | + . print_r( self::___getLegibleDetailedArray( $mValue, $iStringLengthLimit, $iArrayDepthLimit ), true ); |
|
44 | 44 | } |
45 | 45 | return print_r( self::___getLegibleDetailedValue( $mValue, $iStringLengthLimit ), true ); |
46 | 46 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | * @since 3.8.9 |
56 | 56 | * @since 3.8.22 Added the `$sStringLengthLimit` and `$iArrayDepthLimit` parameters. |
57 | 57 | */ |
58 | - static protected function _getLegible( $mValue, $iStringLengthLimit=0, $iArrayDepthLimit=0 ) { |
|
58 | + static protected function _getLegible( $mValue, $iStringLengthLimit = 0, $iArrayDepthLimit = 0 ) { |
|
59 | 59 | |
60 | 60 | $iArrayDepthLimit = $iArrayDepthLimit ? $iArrayDepthLimit : self::$iLegibleArrayDepthLimit; |
61 | 61 | $mValue = is_object( $mValue ) |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | ) |
73 | 73 | : $mValue; |
74 | 74 | $mValue = is_string( $mValue ) |
75 | - ? self::___getLegibleString( $mValue, $iStringLengthLimit, false ) |
|
75 | + ? self::___getLegibleString( $mValue, $iStringLengthLimit, false ) |
|
76 | 76 | : $mValue; |
77 | 77 | return self::_getArrayRepresentationSanitized( print_r( $mValue, true ) ); |
78 | 78 | |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | static private function ___getObjectName( $mItem ) { |
90 | 90 | if ( is_object( $mItem ) ) { |
91 | - return '(object) ' . get_class( $mItem ); |
|
91 | + return '(object) '.get_class( $mItem ); |
|
92 | 92 | } |
93 | 93 | return $mItem; |
94 | 94 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @return string |
100 | 100 | */ |
101 | 101 | static private function ___getLegibleDetailedCallable( $asoCallable ) { |
102 | - return '(callable) ' . self::___getCallableName( $asoCallable ); |
|
102 | + return '(callable) '.self::___getCallableName( $asoCallable ); |
|
103 | 103 | } |
104 | 104 | /** |
105 | 105 | * @since 3.8.9 |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $_sSubject = is_object( $asoCallable[ 0 ] ) |
118 | 118 | ? get_class( $asoCallable[ 0 ] ) |
119 | 119 | : ( string ) $asoCallable[ 0 ]; |
120 | - return $_sSubject . '::' . ( string ) $asoCallable[ 1 ]; |
|
120 | + return $_sSubject.'::'.( string ) $asoCallable[ 1 ]; |
|
121 | 121 | |
122 | 122 | } |
123 | 123 | |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | if ( method_exists( $oObject, '__toString' ) ) { |
132 | 132 | return ( string ) $oObject; |
133 | 133 | } |
134 | - return '(object) ' . get_class( $oObject ) . ' ' . count( get_object_vars( $oObject ) ) . ' properties.'; |
|
134 | + return '(object) '.get_class( $oObject ).' '.count( get_object_vars( $oObject ) ).' properties.'; |
|
135 | 135 | |
136 | 136 | } |
137 | 137 | |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | * @since 3.8.22 Changed the scope to private from public. |
148 | 148 | * @since 3.8.22 Renamed from `_getLegibleArray()`. |
149 | 149 | */ |
150 | - static private function ___getLegibleDetailedArray( array $aArray, $iStringLengthLimit=0, $iDepthLimit=0 ) { |
|
150 | + static private function ___getLegibleDetailedArray( array $aArray, $iStringLengthLimit = 0, $iDepthLimit = 0 ) { |
|
151 | 151 | $_iDepthLimit = $iDepthLimit ? $iDepthLimit : self::$iLegibleArrayDepthLimit; |
152 | 152 | return self::___getArrayMappedRecursive( |
153 | 153 | self::_getSlicedByDepth( $aArray, $_iDepthLimit ), |
@@ -187,9 +187,9 @@ discard block |
||
187 | 187 | return self::___getLegibleDetailedObject( $mNonScalar ); |
188 | 188 | } |
189 | 189 | if ( is_array( $mNonScalar ) ) { |
190 | - return '(' . $_sType . ') ' . count( $mNonScalar ) . ' elements'; |
|
190 | + return '('.$_sType.') '.count( $mNonScalar ).' elements'; |
|
191 | 191 | } |
192 | - return '(' . $_sType . ') ' . ( string ) $mNonScalar; |
|
192 | + return '('.$_sType.') '.( string ) $mNonScalar; |
|
193 | 193 | |
194 | 194 | } |
195 | 195 | /** |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | */ |
202 | 202 | static private function ___getLegibleDetailedScalar( $sScalar, $iStringLengthLimit ) { |
203 | 203 | if ( is_bool( $sScalar ) ) { |
204 | - return '(boolean) ' . ( $sScalar ? 'true' : 'false' ); |
|
204 | + return '(boolean) '.( $sScalar ? 'true' : 'false' ); |
|
205 | 205 | } |
206 | 206 | return is_string( $sScalar ) |
207 | 207 | ? self::___getLegibleString( $sScalar, $iStringLengthLimit, true ) |
208 | - : '(' . gettype( $sScalar ) . ', length: ' . self::___getValueLength( $sScalar ) . ') ' . $sScalar; |
|
208 | + : '('.gettype( $sScalar ).', length: '.self::___getValueLength( $sScalar ).') '.$sScalar; |
|
209 | 209 | } |
210 | 210 | /** |
211 | 211 | * Returns a length of a value. |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | * @param boolean $bShowDetails |
231 | 231 | * @return string |
232 | 232 | */ |
233 | - static private function ___getLegibleString( $sString, $iLengthLimit, $bShowDetails=true ) { |
|
233 | + static private function ___getLegibleString( $sString, $iLengthLimit, $bShowDetails = true ) { |
|
234 | 234 | |
235 | 235 | static $_iMBSupport; |
236 | 236 | $_iMBSupport = isset( $_iMBSupport ) ? $_iMBSupport : ( integer ) function_exists( 'mb_strlen' ); |
@@ -241,8 +241,8 @@ discard block |
||
241 | 241 | |
242 | 242 | if ( $bShowDetails ) { |
243 | 243 | return $_iCharLength <= $iCharLimit |
244 | - ? '(string, length: ' . $_iCharLength . ') ' . $sString |
|
245 | - : '(string, length: ' . $_iCharLength . ') ' . call_user_func_array( $_aSubstrMethod[ $_iMBSupport ], array( $sString, 0, $iCharLimit ) ) |
|
244 | + ? '(string, length: '.$_iCharLength.') '.$sString |
|
245 | + : '(string, length: '.$_iCharLength.') '.call_user_func_array( $_aSubstrMethod[ $_iMBSupport ], array( $sString, 0, $iCharLimit ) ) |
|
246 | 246 | . '...'; |
247 | 247 | } |
248 | 248 | return $_iCharLength <= $iCharLimit |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | * @return array |
284 | 284 | * @since 3.8.22 |
285 | 285 | */ |
286 | - static public function getSlicedByDepth( array $aSubject, $iDepth=0, $sMore='(array truncated) ...' ) { |
|
286 | + static public function getSlicedByDepth( array $aSubject, $iDepth = 0, $sMore = '(array truncated) ...' ) { |
|
287 | 287 | return self::_getSlicedByDepth( $aSubject, $iDepth, $sMore ); |
288 | 288 | } |
289 | 289 | |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | * @since 3.8.22 Added the `$sMore` parameter. |
304 | 304 | * @internal |
305 | 305 | */ |
306 | - static private function _getSlicedByDepth( array $aSubject, $iDepth=0, $sMore='(array truncated) ...' ) { |
|
306 | + static private function _getSlicedByDepth( array $aSubject, $iDepth = 0, $sMore = '(array truncated) ...' ) { |
|
307 | 307 | |
308 | 308 | foreach ( $aSubject as $_sKey => $_vValue ) { |
309 | 309 | |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | * @return array |
339 | 339 | * @since 3.8.9 |
340 | 340 | */ |
341 | - static private function ___getArrayMappedRecursive( array $aArray, $oCallable, array $aArguments=array() ) { |
|
341 | + static private function ___getArrayMappedRecursive( array $aArray, $oCallable, array $aArguments = array() ) { |
|
342 | 342 | |
343 | 343 | self::$___oCurrentCallableForArrayMapRecursive = $oCallable; |
344 | 344 | self::$___aArgumentsForArrayMapRecursive = $aArguments; |
@@ -372,9 +372,9 @@ discard block |
||
372 | 372 | * @since 3.8.22 |
373 | 373 | * @since 3.8.23 Deprecated the `$oException` parameter. |
374 | 374 | */ |
375 | - static public function getStackTrace( $iSkip=0, $_deprecated=null ) { |
|
375 | + static public function getStackTrace( $iSkip = 0, $_deprecated = null ) { |
|
376 | 376 | |
377 | - $_iSkip = 1; // need to skip this method trace itself |
|
377 | + $_iSkip = 1; // need to skip this method trace itself |
|
378 | 378 | $_oException = new Exception(); |
379 | 379 | |
380 | 380 | // Backward compatibility. |
@@ -390,22 +390,22 @@ discard block |
||
390 | 390 | $_aFrames = array_slice( $_aFrames, $_iSkip ); |
391 | 391 | foreach ( array_reverse( $_aFrames ) as $_iIndex => $_aFrame ) { |
392 | 392 | |
393 | - $_aFrame = $_aFrame + array( |
|
393 | + $_aFrame = $_aFrame + array( |
|
394 | 394 | 'file' => null, 'line' => null, 'function' => null, |
395 | 395 | 'class' => null, 'args' => array(), |
396 | 396 | ); |
397 | 397 | $_sArguments = self::___getArgumentsOfEachStackTrace( $_aFrame[ 'args' ] ); |
398 | - $_aTraces[] = sprintf( |
|
398 | + $_aTraces[ ] = sprintf( |
|
399 | 399 | "#%s %s(%s): %s(%s)", |
400 | 400 | $_iIndex + 1, |
401 | 401 | $_aFrame[ 'file' ], |
402 | 402 | $_aFrame[ 'line' ], |
403 | - isset( $_aFrame[ 'class' ] ) ? $_aFrame[ 'class' ] . '->' . $_aFrame[ 'function' ] : $_aFrame[ 'function' ], |
|
403 | + isset( $_aFrame[ 'class' ] ) ? $_aFrame[ 'class' ].'->'.$_aFrame[ 'function' ] : $_aFrame[ 'function' ], |
|
404 | 404 | $_sArguments |
405 | 405 | ); |
406 | 406 | |
407 | 407 | } |
408 | - return implode( PHP_EOL, $_aTraces ) . PHP_EOL; |
|
408 | + return implode( PHP_EOL, $_aTraces ).PHP_EOL; |
|
409 | 409 | |
410 | 410 | } |
411 | 411 | /** |
@@ -420,16 +420,16 @@ discard block |
||
420 | 420 | foreach ( $aTraceArguments as $_mArgument ) { |
421 | 421 | $_sType = gettype( $_mArgument ); |
422 | 422 | $_sType = str_replace( |
423 | - array( 'resource (closed)', 'unknown type', 'integer', 'double', ), |
|
424 | - array( 'resource', 'unknown', 'scalar', 'scalar', ), |
|
423 | + array( 'resource (closed)', 'unknown type', 'integer', 'double',), |
|
424 | + array( 'resource', 'unknown', 'scalar', 'scalar',), |
|
425 | 425 | $_sType |
426 | 426 | ); |
427 | 427 | $_sMethodName = "___getStackTraceArgument_{$_sType}"; |
428 | - $_aArguments[] = method_exists( __CLASS__, $_sMethodName ) |
|
428 | + $_aArguments[ ] = method_exists( __CLASS__, $_sMethodName ) |
|
429 | 429 | ? self::{$_sMethodName}( $_mArgument ) |
430 | 430 | : $_sType; |
431 | 431 | } |
432 | - return join(", ", $_aArguments ); |
|
432 | + return join( ", ", $_aArguments ); |
|
433 | 433 | } |
434 | 434 | /** |
435 | 435 | * @since 3.8.22 |
@@ -439,7 +439,7 @@ discard block |
||
439 | 439 | */ |
440 | 440 | static private function ___getStackTraceArgument_string( $mArgument ) { |
441 | 441 | $_sString = self::___getLegibleString( $mArgument, 200, true ); |
442 | - return "'" . $_sString . "'"; |
|
442 | + return "'".$_sString."'"; |
|
443 | 443 | } |
444 | 444 | static private function ___getStackTraceArgument_scalar( $mArgument ) { |
445 | 445 | return $mArgument; |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | return 'NULL'; |
452 | 452 | } |
453 | 453 | static private function ___getStackTraceArgument_object( $mArgument ) { |
454 | - return 'Object(' . get_class( $mArgument ) . ')'; |
|
454 | + return 'Object('.get_class( $mArgument ).')'; |
|
455 | 455 | } |
456 | 456 | static private function ___getStackTraceArgument_resource( $mArgument ) { |
457 | 457 | return get_resource_type( $mArgument ); |
@@ -464,18 +464,18 @@ discard block |
||
464 | 464 | $_iMax = 10; |
465 | 465 | $_iTotal = count( $mArgument ); |
466 | 466 | $_iIndex = 0; |
467 | - foreach( $mArgument as $_sKey => $_mValue ) { |
|
467 | + foreach ( $mArgument as $_sKey => $_mValue ) { |
|
468 | 468 | $_iIndex++; |
469 | - $_mValue = is_scalar( $_mValue ) |
|
469 | + $_mValue = is_scalar( $_mValue ) |
|
470 | 470 | ? self::___getLegibleDetailedScalar( $_mValue, 100 ) |
471 | - : ucfirst( gettype( $_mValue ) ) . ( |
|
471 | + : ucfirst( gettype( $_mValue ) ).( |
|
472 | 472 | is_object( $_mValue ) |
473 | - ? ' (' . get_class( $_mValue ) . ')' |
|
473 | + ? ' ('.get_class( $_mValue ).')' |
|
474 | 474 | : '' |
475 | 475 | ); |
476 | - $_sOutput .= $_sKey . ': ' . $_mValue . ', '; |
|
476 | + $_sOutput .= $_sKey.': '.$_mValue.', '; |
|
477 | 477 | if ( $_iIndex > $_iMax && $_iTotal > $_iMax ) { |
478 | - $_sOutput = rtrim( $_sOutput, ',' ) . '...'; |
|
478 | + $_sOutput = rtrim( $_sOutput, ',' ).'...'; |
|
479 | 479 | break; |
480 | 480 | } |
481 | 481 | } |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | 'getPostTypeByTypeNow', |
57 | 57 | 'getPostTypeByScreenObject', |
58 | 58 | 'getPostTypeByREQUEST', |
59 | - 'getPostTypeByPostObject', // 3.6.0+ Moved to the last as it is not reliable. |
|
59 | + 'getPostTypeByPostObject', // 3.6.0+ Moved to the last as it is not reliable. |
|
60 | 60 | ); |
61 | 61 | foreach ( $_aMethodsToTry as $_sMethodName ) { |
62 | 62 | $_sPostType = call_user_func( array( __CLASS__, $_sMethodName ) ); |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | * @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. |
121 | 121 | * @return boolean |
122 | 122 | */ |
123 | - static public function isCustomTaxonomyPage( $asPostTypes=array() ) { |
|
123 | + static public function isCustomTaxonomyPage( $asPostTypes = array() ) { |
|
124 | 124 | |
125 | - if ( ! in_array( self::getPageNow(), array( 'tags.php', 'edit-tags.php', 'term.php' ) ) ) { |
|
125 | + if ( !in_array( self::getPageNow(), array( 'tags.php', 'edit-tags.php', 'term.php' ) ) ) { |
|
126 | 126 | return false; |
127 | 127 | } |
128 | 128 | return self::isCurrentPostTypeIn( $asPostTypes ); |
@@ -137,10 +137,10 @@ discard block |
||
137 | 137 | * Otherwise, it will check if the page belongs to the given post type(s). |
138 | 138 | * @return boolean |
139 | 139 | */ |
140 | - static public function isPostDefinitionPage( $asPostTypes=array() ) { |
|
140 | + static public function isPostDefinitionPage( $asPostTypes = array() ) { |
|
141 | 141 | |
142 | 142 | // If it's not the post definition page, |
143 | - if ( ! in_array( self::getPageNow(), array( 'post.php', 'post-new.php', ) ) ) { |
|
143 | + if ( !in_array( self::getPageNow(), array( 'post.php', 'post-new.php',) ) ) { |
|
144 | 144 | return false; |
145 | 145 | } |
146 | 146 | return self::isCurrentPostTypeIn( $asPostTypes ); |
@@ -173,14 +173,14 @@ discard block |
||
173 | 173 | * |
174 | 174 | * @since 3.0.0 |
175 | 175 | */ |
176 | - static public function isPostListingPage( $asPostTypes=array() ) { |
|
176 | + static public function isPostListingPage( $asPostTypes = array() ) { |
|
177 | 177 | |
178 | 178 | if ( 'edit.php' != self::getPageNow() ) { |
179 | 179 | return false; |
180 | 180 | } |
181 | 181 | |
182 | 182 | $_aPostTypes = self::getAsArray( $asPostTypes ); |
183 | - if ( ! isset( $_GET[ 'post_type' ] ) ) { |
|
183 | + if ( !isset( $_GET[ 'post_type' ] ) ) { |
|
184 | 184 | return in_array( 'post', $_aPostTypes, true ); |
185 | 185 | } |
186 | 186 | return in_array( $_GET[ 'post_type' ], $_aPostTypes, true ); |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | 0 => '_getPageNow_FrontEnd', |
218 | 218 | 1 => '_getPageNow_BackEnd', |
219 | 219 | ); |
220 | - $_sMethodName = $_aMethodNames[ ( integer ) is_admin() ]; |
|
220 | + $_sMethodName = $_aMethodNames[ ( integer ) is_admin() ]; |
|
221 | 221 | self::$_sPageNow = self::$_sMethodName(); |
222 | 222 | return self::$_sPageNow; |
223 | 223 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | |
313 | 313 | if ( isset( $GLBOALS[ 'page_hook' ] ) ) { |
314 | 314 | return is_network_admin() |
315 | - ? $GLBOALS[ 'page_hook' ] . '-network' |
|
315 | + ? $GLBOALS[ 'page_hook' ].'-network' |
|
316 | 316 | : $GLBOALS[ 'page_hook' ]; |
317 | 317 | } |
318 | 318 | |
@@ -326,11 +326,11 @@ discard block |
||
326 | 326 | * @since 3.7.0 |
327 | 327 | * @return boolean |
328 | 328 | */ |
329 | - static public function doesMetaBoxExist( $sContext='' ) { |
|
329 | + static public function doesMetaBoxExist( $sContext = '' ) { |
|
330 | 330 | |
331 | 331 | $_aDimensions = array( 'wp_meta_boxes', $GLOBALS[ 'page_hook' ] ); |
332 | 332 | if ( $sContext ) { |
333 | - $_aDimensions[] = $sContext; |
|
333 | + $_aDimensions[ ] = $sContext; |
|
334 | 334 | } |
335 | 335 | $_aSideMetaBoxes = self::getElementAsArray( |
336 | 336 | $GLOBALS, |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public $sNotice = ''; |
46 | 46 | public $aAttributes = array(); |
47 | 47 | public $aCallbacks = array( |
48 | - 'should_show' => null, // determines whether the admin notice should be displayed. |
|
48 | + 'should_show' => null, // determines whether the admin notice should be displayed. |
|
49 | 49 | ); |
50 | 50 | /**#@-*/ |
51 | 51 | |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | * </ul> |
62 | 62 | * @since 3.5.0 |
63 | 63 | */ |
64 | - public function __construct( $sNotice, array $aAttributes=array( 'class' => 'error' ), array $aCallbacks=array() ) { |
|
64 | + public function __construct( $sNotice, array $aAttributes = array( 'class' => 'error' ), array $aCallbacks = array() ) { |
|
65 | 65 | |
66 | 66 | $this->aAttributes = $aAttributes + array( |
67 | 67 | 'class' => 'error', // 'updated' etc. |
@@ -69,17 +69,17 @@ discard block |
||
69 | 69 | $this->aAttributes[ 'class' ] = $this->getClassAttribute( |
70 | 70 | $this->aAttributes[ 'class' ], |
71 | 71 | 'admin-page-framework-settings-notice-message', |
72 | - 'admin-page-framework-settings-notice-container', // Moved from `AdminPageFramework_Factory_View`. |
|
72 | + 'admin-page-framework-settings-notice-container', // Moved from `AdminPageFramework_Factory_View`. |
|
73 | 73 | 'notice', |
74 | 74 | 'is-dismissible' // 3.5.12+ |
75 | 75 | ); |
76 | - $this->aCallbacks = $aCallbacks + $this->aCallbacks; |
|
76 | + $this->aCallbacks = $aCallbacks + $this->aCallbacks; |
|
77 | 77 | |
78 | 78 | // Load resources. |
79 | 79 | new AdminPageFramework_AdminNotice___Script; |
80 | 80 | |
81 | 81 | // An empty value may be set in order only to load the fade-in script. |
82 | - if ( ! $sNotice ) { |
|
82 | + if ( !$sNotice ) { |
|
83 | 83 | return; |
84 | 84 | } |
85 | 85 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function _replyToDisplayAdminNotice() { |
109 | 109 | |
110 | - if ( ! $this->_shouldProceed() ) { |
|
110 | + if ( !$this->_shouldProceed() ) { |
|
111 | 111 | return; |
112 | 112 | } |
113 | 113 | |
@@ -118,14 +118,14 @@ discard block |
||
118 | 118 | 'display: none' |
119 | 119 | ); |
120 | 120 | |
121 | - echo "<div " . $this->getAttributes( $_aAttributes ) . ">" |
|
121 | + echo "<div ".$this->getAttributes( $_aAttributes ).">" |
|
122 | 122 | . "<p>" |
123 | 123 | . self::$_aNotices[ $this->sNotice ] |
124 | 124 | . "</p>" |
125 | 125 | . "</div>" |
126 | 126 | // Insert the same message except it is not hidden. |
127 | 127 | . "<noscript>" |
128 | - . "<div " . $this->getAttributes( $this->aAttributes ) . ">" |
|
128 | + . "<div ".$this->getAttributes( $this->aAttributes ).">" |
|
129 | 129 | . "<p>" |
130 | 130 | . self::$_aNotices[ $this->sNotice ] |
131 | 131 | . "</p>" |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | private function _shouldProceed() { |
145 | 145 | |
146 | - if ( ! is_callable( $this->aCallbacks[ 'should_show' ] ) ) { |
|
146 | + if ( !is_callable( $this->aCallbacks[ 'should_show' ] ) ) { |
|
147 | 147 | return true; |
148 | 148 | } |
149 | 149 | return call_user_func_array( |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @since 3.8.24 |
26 | 26 | */ |
27 | 27 | static public function getHTTPRequestSanitized( array $aRequest, $bStripSlashes ) { |
28 | - foreach( $aRequest as $_isIndex => $_mValue ) { |
|
28 | + foreach ( $aRequest as $_isIndex => $_mValue ) { |
|
29 | 29 | if ( is_array( $_mValue ) ) { |
30 | 30 | $aRequest[ $_isIndex ] = self::getHTTPRequestSanitized( $_mValue, $bStripSlashes ); |
31 | 31 | continue; |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @return mixed |
69 | 69 | * @since 3.8.24 |
70 | 70 | */ |
71 | - static public function getObjectCache( $asName, $mDefault=null ) { |
|
71 | + static public function getObjectCache( $asName, $mDefault = null ) { |
|
72 | 72 | return self::getArrayValueByArrayKeys( self::$___aObjectCache, self::getAsArray( $asName ), $mDefault ); |
73 | 73 | } |
74 | 74 | |
@@ -83,9 +83,9 @@ discard block |
||
83 | 83 | * @param string $sProgramName |
84 | 84 | * @since 3.8.8 |
85 | 85 | */ |
86 | - static public function showDeprecationNotice( $sDeprecated, $sAlternative='', $sProgramName='Admin Page Framework' ) { |
|
86 | + static public function showDeprecationNotice( $sDeprecated, $sAlternative = '', $sProgramName = 'Admin Page Framework' ) { |
|
87 | 87 | trigger_error( |
88 | - $sProgramName . ': ' . sprintf( |
|
88 | + $sProgramName.': '.sprintf( |
|
89 | 89 | $sAlternative |
90 | 90 | ? '<code>%1$s</code> has been deprecated. Use <code>%2$s</code> instead.' |
91 | 91 | : '<code>%1$s</code> has been deprecated.', |
@@ -108,8 +108,8 @@ discard block |
||
108 | 108 | * @param string|array $asParameters Parameters to pass to the callback function. |
109 | 109 | * @return mixed |
110 | 110 | */ |
111 | - public function callBack( $oCallable, $asParameters=array() ) { |
|
112 | - $_aParameters = self::getAsArray( |
|
111 | + public function callBack( $oCallable, $asParameters = array() ) { |
|
112 | + $_aParameters = self::getAsArray( |
|
113 | 113 | $asParameters, |
114 | 114 | true // preserve empty |
115 | 115 | ); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * @param array $aParameters |
149 | 149 | * @return string The captured output buffer. |
150 | 150 | */ |
151 | - static public function getOutputBuffer( $cCallable, array $aParameters=array() ) { |
|
151 | + static public function getOutputBuffer( $cCallable, array $aParameters = array() ) { |
|
152 | 152 | |
153 | 153 | ob_start(); |
154 | 154 | echo call_user_func_array( $cCallable, $aParameters ); |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | $_iCount = count( get_object_vars( $oInstance ) ); |
172 | 172 | $_sClassName = get_class( $oInstance ); |
173 | - return '(object) ' . $_sClassName . ': ' . $_iCount . ' properties.'; |
|
173 | + return '(object) '.$_sClassName.': '.$_iCount.' properties.'; |
|
174 | 174 | |
175 | 175 | } |
176 | 176 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | * @param boolean|integer|double|string|array|object|resource|NULL $mFalse The value to return when the first parameter value yields false. |
188 | 188 | * @return mixed |
189 | 189 | */ |
190 | - static public function getAOrB( $mValue, $mTrue=null, $mFalse=null ) { |
|
190 | + static public function getAOrB( $mValue, $mTrue = null, $mFalse = null ) { |
|
191 | 191 | return $mValue ? $mTrue : $mFalse; |
192 | 192 | } |
193 | 193 |