Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#23966 closed enhancement (invalid)

Allow to use order_by in addition to orderby

Reported by: denis-de-bernardy's profile Denis-de-Bernardy Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.5
Component: Taxonomy Keywords:
Focuses: Cc:

Description

http://codex.wordpress.org/Function_Reference/get_categories

The above link and the same for wp_list_categories suggests that you can order categories by count. In practice it seems to ignore the parameter. It doesn't seem to work with a few other parameters either -- the only things that seem to work are ID, name, and slug, but these might merely be incidental to the fact that I created my test categories in alphabetical order.

Change History (8)

#1 follow-up: @Denis-de-Bernardy
12 years ago

  • Component changed from General to Taxonomy
  • Severity changed from normal to minor
  • Type changed from defect (bug) to enhancement
  • Version set to trunk

Oh, bummer, nevermind -- a silly typo: I used order_by instead of orderby...

So, rephrasing this as an enhancement request: be more forgiving and allow to use order_by as well as orderby.

#2 @Denis-de-Bernardy
12 years ago

  • Summary changed from Order by count not honored by get_categories() to Allow to use order_by in addition to orderby -- was: order by count not honored by get_categories()

#3 @nacin
12 years ago

We're not great on consistency in general, but we use "orderby" exclusively in core.

The only places where "order_by" is found are:

  • As a local variable in class-wp-ms-sites-list-table.php (but it represents $_GET['orderby'])
  • As dead code in edit-link-form.php that was removed in [23445] but re-added in [23554] (and now about to be removed again)

#5 @nacin
12 years ago

Good to see you again, Denis.

#6 in reply to: ↑ 1 @SergeyBiryukov
12 years ago

  • Keywords close added
  • Summary changed from Allow to use order_by in addition to orderby -- was: order by count not honored by get_categories() to Allow to use order_by in addition to orderby
  • Version changed from trunk to 3.5

Replying to Denis-de-Bernardy:

So, rephrasing this as an enhancement request: be more forgiving and allow to use order_by as well as orderby.

Adding order_by as an alias for orderby just in get_categories() would be inconsistent with other functions that accept orderby.

Doing that for all the functions still doesn't seem like a good idea.

#7 @aaronholbrook
12 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Closing as invalid - this doesn't seem like something we should be doing.

#8 @ocean90
12 years ago

  • Keywords close removed
  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.