Skip to content

Commit 03c6e20

Browse files
authored
fix: iron out warnings/errors/deprecations from PHP 8.0 upgrade #1384 (#1402)
* fix: return -1, 0, 1 from uksort and uasort callbacks * fix: deprecated parameter order from PHP8
1 parent 028a6f1 commit 03c6e20

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

archive-template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ class="second-bar show-for-small-only center list-actions-bar"><!-- /* MOBILE V
459459
if ( isset( $b["show_in_table"] ) ){
460460
$b_order = is_numeric( $b["show_in_table"] ) ? $b["show_in_table"] : 90;
461461
}
462-
return $a_order > $b_order;
462+
return $a_order <=> $b_order;
463463
});
464464
foreach ( $post_settings["fields"] as $field_key => $field_value ){
465465
if ( ( isset( $field_value["show_in_table"] ) && $field_value["show_in_table"] ) ){

dt-contacts/access-module.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public function dt_custom_fields_settings( $fields, $post_type ){
351351

352352
//order overall status options
353353
uksort( $declared_fields["overall_status"]["default"], function ( $a, $b ) use ( $fields ){
354-
return array_search( $a, array_keys( $fields["overall_status"]["default"] ) ) > array_search( $b, array_keys( $fields["overall_status"]["default"] ) );
354+
return array_search( $a, array_keys( $fields["overall_status"]["default"] ) ) <=> array_search( $b, array_keys( $fields["overall_status"]["default"] ) );
355355
} );
356356
$fields = $declared_fields;
357357
}

dt-core/libraries/posts-to-posts/vendor/scribu/scb-framework/Cron.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ class scbCron {
2121
*
2222
* @return void
2323
*/
24-
public function __construct( $file = false, $args ) {
24+
public function __construct( $file = false, $args = array() ) {
25+
26+
if ( empty( $args ) ) {
27+
return;
28+
}
2529

2630
// Set time & schedule
2731
if ( isset( $args['time'] ) ) {

dt-core/libraries/posts-to-posts/vendor/scribu/scb-framework/Forms.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public static function form_table( $rows, $formdata = null ) {
6262
*
6363
* @return string
6464
*/
65-
public static function form( $inputs, $formdata = null, $nonce ) {
65+
public static function form( $inputs, $formdata = null, $nonce = 'update_options' ) {
6666
$output = '';
6767
foreach ( $inputs as $input ) {
6868
$output .= self::input( $input, $formdata );
@@ -1045,4 +1045,3 @@ public function validate( $value ) {
10451045
return call_user_func( $this->sanitize, $value, $this );
10461046
}
10471047
}
1048-

0 commit comments

Comments
 (0)