feat: exclude default metadata section if present in `post__not_in`
This commit is contained in:
parent
61d570f0e6
commit
392184512d
|
@ -295,7 +295,9 @@ class Metadata_Sections extends Repository {
|
|||
$args['meta_query'][] = $meta_query;
|
||||
$results = $this->fetch( $args, 'OBJECT' );
|
||||
}
|
||||
$results[] = $this->get_default_section($collection->get_id());
|
||||
if ( !isset($args['post__not_in']) || !in_array(\Tainacan\Entities\Metadata_Section::$default_section_slug, $args['post__not_in']) ) {
|
||||
$results[] = $this->get_default_section($collection->get_id());
|
||||
}
|
||||
|
||||
return $this->order_result(
|
||||
$results,
|
||||
|
|
Loading…
Reference in New Issue