dimanche 30 novembre 2014

How add a group by to the query used by the media library?


What would be the proper way to add a group by to the media library query? What I have tired so far is not working:



add_filter('posts_groupby ', 'limitMediaLibraryItems', 10, 2 );
function limitMediaLibraryItems($groupby) {

if ( strpos( $_SERVER[ 'REQUEST_URI' ], '/wp-admin/upload.php' ) !== false ) {
$groupby .= " guid";
}

return $groupby;
}




Aucun commentaire:

Enregistrer un commentaire