那么,您需要包括类型比较,或者这里应用字母数字比较。
在这种情况下,您应该添加\'type\' => \'numeric\'
.
Using Your Class Function
<?php
public function list_related_docs($id){
$docs_args = array(
\'post_type\' => \'publication\',
\'post_status\' => \'publish\',
\'posts_per_page\'=> -1,
\'orderby\' => \'meta_value_num title\',
\'order\' => \'ASC\',
\'meta_key\' => \'fund_list_order\',
\'limit\' => 4,
\'suppress_filters\' => 0,
\'meta_query\' => array(
\'relation\' => \'AND\',
array(
\'key\' => \'funds_id\',
\'value\' => $id,
\'compare\' => \'=\',
\'type\' => \'numeric\',
),
array(
\'key\' => \'fund_list_order\',
\'compare\' => \'EXISTS\',
)
)
);
$docs_posts = get_posts($docs_args);
// more stuff
}