I have a terms query loop on a product page to show a set of terms with fields on the page. I am trying to use the new query editor so that I can order the terms by a specific meta field but I cannot seem to get the query editor to work. Not sure if I’m missing something or just don’t understand it enough. Here’s a screenshot of the existing query loop settings:
And here is the code I’ve attempted to use in the query editor:
$taxonomy = '{post_terms_variation}';
$orderBy = '{pods_variation_order_by}';
$postId = '{post_id}';
return [
'taxonomy' => [$taxonomy],
'orderby' => 'meta_value_num',
'meta_key' => [$orderBy],
'order' => 'ASC',
'object_ids' => [$postId],
];
Any assistance would be appreciated.
Thank-you