Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

everyone, is there way to order categories in add/edit post in admin dashboard. The problem is my order must be custom, not by Name or ID. For example:

  • Rumors (id 5)
  • News (id 1)
  • Features (id 7)
  • etc.

    The ideal solution will be to order categories by description. That way in category description field I will put number or letter and categories will order right.

Thank you in advance!

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Use the get_terms_args hook and modify the orderby argument, like so:

add_filter( 'get_terms_args', 'my_sort_terms', 10, 2 );
function my_sort_terms( $args, $taxonomies ) {

    $args['orderby'] = 'description';

    return $args;
}

Possible values for this argument are listed in the codex.

share|improve this answer
    
Thank you for the fast comment. With your code and little edits, now it check the description of the categories and order them like I want. –  Dido Kotsev Feb 27 '13 at 15:33
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.