📅  最后修改于: 2022-03-11 14:48:23.428000             🧑  作者: Mango
$query->set( 'meta_query', array(
'relation' => 'OR',
array(
'key' => 'custom_meta_key',
'compare' => 'EXISTS'
),
array(
'key' => 'custom_meta_key',
'compare' => 'NOT EXISTS'
)
) );
$query->set( 'orderby', 'meta_value title' );