WordPress.org

Make WordPress Core

Opened 13 months ago

Closed 9 months ago

Last modified 8 months ago

#23966 closed enhancement (invalid)

Allow to use order_by in addition to orderby

Reported by: 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)

comment:1 follow-up: Denis-de-Bernardy13 months 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.

comment:2 Denis-de-Bernardy13 months 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()

comment:3 nacin13 months 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)

comment:5 nacin13 months ago

Good to see you again, Denis.

comment:6 in reply to: ↑ 1 SergeyBiryukov13 months 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.

comment:7 aaronholbrook9 months ago

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

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

comment:8 ocean908 months ago

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