Replace loop for a correct fetch call

This commit is contained in:
Leo Germani 2018-01-12 16:36:21 -02:00
parent ae8f2f7dde
commit 73b27ac97a
1 changed files with 1 additions and 7 deletions

View File

@ -153,13 +153,7 @@ class Items extends Repository {
}
if (empty($collections)){
$wp_query = $Tainacan_Collections->fetch();
if( $wp_query->have_posts() ){
while ( $wp_query->have_posts() ){
$wp_query->the_post();
$collections[] = new Entities\Collection( get_the_ID() );
}
}
$collections = $Tainacan_Collections->fetch([], 'OBJECT');
}
if (is_numeric($collections)){