Skip to content

Commit

Permalink
Define array before foreach loop (#8147)
Browse files Browse the repository at this point in the history
  • Loading branch information
Umangvaghela authored and oskosk committed Nov 13, 2017
1 parent db7a9a0 commit 38d2498
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/related-posts/jetpack-related-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,9 @@ protected function _get_es_filters_from_args( $post_id, array $args ) {
*/
$args['exclude_post_ids'] = apply_filters( 'jetpack_relatedposts_filter_exclude_post_ids', $args['exclude_post_ids'], $post_id );
if ( !empty( $args['exclude_post_ids'] ) && is_array( $args['exclude_post_ids'] ) ) {
$excluded_post_ids = array();
foreach ( $args['exclude_post_ids'] as $exclude_post_id) {
$exclude_post_id = (int)$exclude_post_id;
$excluded_post_ids = array();
if ( $exclude_post_id > 0 )
$excluded_post_ids[] = $exclude_post_id;
}
Expand Down

0 comments on commit 38d2498

Please sign in to comment.