WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 6 years ago

#3358 closed defect (bug) (worksforme)

Changing Sort Options in Admin Doesn't Work

Reported by: bryanveloso Owned by: anonymous
Priority: normal Milestone:
Component: Administration Version: 2.0.5
Severity: normal Keywords:
Cc:

Description

I changed:

wp('post_type=page&orderby=menu_order&what_to_show=posts&posts_per_page=-1&posts_per_archive_page=-1');

to

wp('post_type=page&orderby=post_title&what_to_show=posts&posts_per_page=-1&posts_per_archive_page=-1');

because my fiance wanted her pages sorted as such, by post title. However, they don't sort by post title after I do this. The sorting mechanism just breaks altogether. I tried this with the SQL statement from 2.0.5, and that also didn't work when I changed it to sort by post title.

Change History (4)

comment:1 follow-up: bryanveloso7 years ago

Oh, this line is #22 in edit-pages.php.

comment:2 in reply to: ↑ 1 westi7 years ago

Looking at query.php (in trunk) you don't want to use post_title but just title here:

The 'allowed' values are:
$allowed_keys = array('author', 'date', 'category', 'title', 'modified', 'menu_order');

The relavent code is here

if ( 'menu_order' != $orderby )
    $orderby = 'post_' . $orderby;

comment:3 bryanveloso7 years ago

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

Thanks westi. :)

comment:4 Nazgul6 years ago

  • Milestone 2.1 deleted
Note: See TracTickets for help on using tickets.