您可以在上筛选这些关键字的查询\'query\'
. 我会尽可能晚地启动过滤器,以避免副作用。
示例代码,tested:
add_filter( \'postmeta_form_limit\', \'wpse_73543_hide_meta_start\' );
function wpse_73543_hide_meta_start( $num )
{
add_filter( \'query\', \'wpse_73543_hide_meta_filter\' );
return $num;
}
function wpse_73543_hide_meta_filter( $query )
{
// Protect further queries.
remove_filter( current_filter(), __FUNCTION__ );
$forbidden = array ( \'the\', \'keys\', \'you\', \'want\', \'to\', \'hide\' );
$where = "WHERE meta_key NOT IN(\'" . join( "\', \'", $forbidden ) . "\') ";
$find = "GROUP BY";
$query = str_replace( $find, "$where\\n$find", $query );
return $query;
}