fix filter by meta_query using key `_option_taxonomy_id`

This commit is contained in:
vnmedeiros 2020-02-19 12:50:03 -03:00
parent 5b45827356
commit 568987a255
1 changed files with 11 additions and 1 deletions

View File

@ -1495,7 +1495,17 @@ class Metadata extends Repository {
$taxonomy_id = $taxonomy->get_id();
$metadata = $this->fetch(['metadata_type' => 'Tainacan\Metadata_Types\Taxonomy', '_option_taxonomy_id' => $taxonomy_id, 'post_status' => $stati], 'OBJECT');
$args = [
'metadata_type' => 'Tainacan\Metadata_Types\Taxonomy',
'meta_query' => [
[
'key' => '_option_taxonomy_id',
'value' => $taxonomy_id
]
],
'post_status' => $stati
];
$metadata = $this->fetch($args, 'OBJECT');
foreach ($metadata as $meta) {
$meta->set_status( $taxonomy->get_status() );