我有一个带有自定义字段的文字新闻网站。我需要将转发器字段作为表进行查询。它看起来像这样:
| param_1 | param_2 | param_2 | param_4
| 20 | 20 | 20 | 20
| 555 | 680 | 56 | 0
| 5555 | 45 | 56 | 1
| 69 | 0 | 45 | 0
Run Code Online (Sandbox Code Playgroud)
只有当它与同一行中的查询匹配时,我才需要查询此转发器以获取结果
我的元查询看起来像这样:
[post_type] => product
[posts_per_page] => -1
[orderby] => title
[order] => ASC
[meta_query] => Array (
[relation] => AND
[0] => Array (
[key] => BBBproduct_params_values_AAA_param_value_0
[value] => 25
[compare] => <=
[type] => NUMERIC
)
[1] …Run Code Online (Sandbox Code Playgroud) 我必须获得具有特定元值的帖子dynamic meta key。
这些meta key值将是:
元键中的常见文本是trend_link。所以我需要添加like operatorfor meta key.
$posts = get_posts(array(
'numberposts' => -1,
'post_type' => 'projects',
'meta_query' => array(
array(
'key' => 'trend_link',
'value' => 10,
'compare' => 'LIKE'
)
)
));
Run Code Online (Sandbox Code Playgroud)
通过使用此代码,我可以like operator在meta_value.
但我需要
like operator申请meta_key。
有什么办法可以申请like operator吗meta_key?
请帮忙 !!