Skip to content

Commit

Permalink
Swap join() with implode()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mjangda committed Jan 20, 2021
1 parent dc79c06 commit ee9bf54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/calendar/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ function get_calendar_posts_for_week( $args = array(), $context = 'dashboard' )
$post_stati = wp_filter_object_list( $post_stati, array( 'name' => 'future' ), 'not' );
}

$args['post_status'] .= join( wp_list_pluck( $post_stati, 'name' ), ',' );
$args['post_status'] .= implode( ',', wp_list_pluck( $post_stati, 'name' ) );
}
// The WP functions for printing the category and author assign a value of 0 to the default
// options, but passing this to the query is bad (trashed and auto-draft posts appear!), so
Expand Down
2 changes: 1 addition & 1 deletion modules/story-budget/story-budget.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ function get_posts_for_term( $term, $args = null ) {
$post_stati = wp_filter_object_list( $post_stati, array( 'name' => 'future' ), 'not' );
}

$args['post_status'] .= join( wp_list_pluck( $post_stati, 'name' ), ',' );
$args['post_status'] .= implode( ',', wp_list_pluck( $post_stati, 'name' ) );
}

// Filter by post_author if it's set
Expand Down

0 comments on commit ee9bf54

Please sign in to comment.