Skip to content

Instantly share code, notes, and snippets.

@Ciantic
Created December 5, 2011 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ciantic/1434657 to your computer and use it in GitHub Desktop.
Save Ciantic/1434657 to your computer and use it in GitHub Desktop.
default sorting order of all list views in admin
<?PHP
function post_order_type_default_sorting(&$query) {
if (!isset($query->query['orderby'])) {
$query->set('orderby', 'menu_order');
}
}
function post_order_type_list_view() {
add_action('pre_get_posts', 'post_order_type_default_sorting', 1, 1);
}
add_action("load-edit.php", 'post_order_type_list_view');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment