Skip to content

Commit 6d63021

Browse files
mjangdanielslangehtdat
authored
Swap join() with implode() (#627)
And correct the order of the params. PHP 7.4 changes the order of the params for the join() function and implode() is the preferred way to join an array of strings anyway. Co-authored-by: Niels Lange <info@nielslange.de> Co-authored-by: Dat Hoang <htdat@users.noreply.github.com>
1 parent fbb9cbf commit 6d63021

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

modules/calendar/calendar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ function get_calendar_posts_for_week( $args = array(), $context = 'dashboard' )
12231223
$post_stati = wp_filter_object_list( $post_stati, array( 'name' => 'future' ), 'not' );
12241224
}
12251225

1226-
$args['post_status'] .= join( wp_list_pluck( $post_stati, 'name' ), ',' );
1226+
$args['post_status'] .= implode( ',', wp_list_pluck( $post_stati, 'name' ) );
12271227
}
12281228
// The WP functions for printing the category and author assign a value of 0 to the default
12291229
// options, but passing this to the query is bad (trashed and auto-draft posts appear!), so

modules/story-budget/story-budget.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ function get_posts_for_term( $term, $args = null ) {
411411
$post_stati = wp_filter_object_list( $post_stati, array( 'name' => 'future' ), 'not' );
412412
}
413413

414-
$args['post_status'] .= join( wp_list_pluck( $post_stati, 'name' ), ',' );
414+
$args['post_status'] .= implode( ',', wp_list_pluck( $post_stati, 'name' ) );
415415
}
416416

417417
// Filter by post_author if it's set

0 commit comments

Comments
 (0)