S
S
Socrates2018-04-08 20:00:50
WordPress
Socrates, 2018-04-08 20:00:50

Sort taxonomy in get_terms by metabox?

Hello everyone, help me understand.
What is:
1. The created taxonomy
2. The "order" metabox created for this taxonomy
3. when displaying the category of this taxonomy by get_terms I try to sort them by the created metabox

$terms = get_terms([
    'taxonomy' => "taxbeton", 
    'orderby' => 'taxorder', // название метабокса (поля)
    'hide_empty' => false
]);

But this approach does not work, the documentation says:
for orderby, you can use:
the "meta_query" key - in the $meta_query parameter, we can specify query parameters by meta fields, and specify the key for a specific request there. This key can be used as a sort key for the corresponding meta field.
Please help, I don't know how to solve this

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Socrates, 2018-04-08
@Karmov69

'meta_key' => '',
'orderby' => 'meta_value',
'order' => 'ASC'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question