也许有点快,有点脏,但这应该行得通:
function media_library_hide_dlm_downloads($where) {
if(isset($_POST[\'action\']) && ( $_POST[\'action\'] == \'query-attachments\')) {
$where .= \' AND guid NOT LIKE "%wp-content/uploads/dlm_downloads%"\';
}
return $where;
}
add_filter(\'posts_where\', \'media_library_hide_dlm_downloads\');
了解更多有关
posts_where filter.