Created
September 20, 2011 02:12
-
-
Save jeremyboggs/1228149 to your computer and use it in GitHub Desktop.
Filter the collections browse SQL to sort records alphabetically by name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter the collections browse SQL to sort records alphabetically by name. | |
*/ | |
function filter_collections_alphabetically($select, $params) | |
{ | |
if (!array_key_exists('sort_field', $params)) { | |
$select->order('c.name ASC'); | |
} | |
return $select; | |
} | |
add_plugin_hook('collection_browse_sql', 'filter_collections_alphabetically'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment