reference: meta_query with MB Custom Tables
I need to loop (ordered and field-selected) through a custom database with Oxygen page builder.
So there is no other way as to use a meta_query!
You are offering "MB Custom Table" but as far as I understood no way to order such a table with meta_query.
The referenced post is dated Feb 2018.
Your comment was:
"I’m not sure about this, because the way WordPress build SQL queries from meta query object is very complicated. I’ll see if I can do something."
Was there any change within the roughly 2 years?
If no implementation was possible: Is there any workaround on how to implement the first SQL request in a meta_query?
Query:
$args = array(
'post_type' => 'square',
'meta_key' => 'sq_text_order',
// not meta-value-num, as it is a text field
'orderby' => 'meta_value',
'order' => 'ASC',
'meta_query' => array(
array(
'key' => 'sq_select_squarematrix',
'value' => 'Home',
'compare' => '='
)
)
)
);
or:
post_type=square&meta_key=sq_text_order&orderby=meta_value&order=ASC&meta_query%5B0%5D%5Bkey%5D=sq_select_squarematrix&meta_query%5B0%5D%5Bvalue%5D=Home&meta_query%5B0%5D%5Bcompare%5D==