WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#36515 closed enhancement (fixed)

WP_Query should be able to order by specific order as "post_name__in"

Reported by: postpostmodern Owned by: boonebgorges
Milestone: 4.6 Priority: normal
Severity: normal Version: 4.4
Component: Query Keywords: has-patch has-unit-tests
Focuses: Cc:

Description

Support post_name__in as an orderby argument in WP_Query to match post__in and post_parent__in

Attachments (2)

query.diff (1.2 KB) - added by postpostmodern 3 years ago.
Patch for wp-includes/query.php
test-query.diff (1.3 KB) - added by postpostmodern 3 years ago.
Patch for tests/phpunit/tests/post/query.php

Download all attachments as: .zip

Change History (5)

@postpostmodern
3 years ago

Patch for wp-includes/query.php

@postpostmodern
3 years ago

Patch for tests/phpunit/tests/post/query.php

#1 @swissspidy
3 years ago

  • Keywords has-patch has-unit-tests added
  • Milestone changed from Awaiting Review to Future Release

#2 @boonebgorges
3 years ago

  • Milestone changed from Future Release to 4.6

@postpostmodern Thanks for the great patches!

#3 @boonebgorges
3 years ago

  • Owner set to boonebgorges
  • Resolution set to fixed
  • Status changed from new to closed

In 37225:

Query: Allow results to be ordered by post_parent__in.

Props postpostmodern.
Fixes #36515.

Note: See TracTickets for help on using tickets.