Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#39336 closed defect (bug) (fixed)

Document WP_Query orderby=relevance

Reported by: jnylen0 Owned by: boonebgorges
Priority: normal Milestone: 4.8
Component: Query Version: 3.7
Severity: minor Keywords: has-patch
Cc: Focuses: docs

Description

I expected relevance to show up here - https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters

There may be other parameters/values that are also missing from the WP_Query documentation.

Attachments (4)

39336.patch (1.1 KB ) - added by dots 10 years ago.
39336.2.patch (2.0 KB ) - added by dots 10 years ago.
39336.3.patch (2.0 KB ) - added by dots 10 years ago.
Please ignore 39336.2.patch
39336.4.patch (1.9 KB ) - added by boonebgorges 10 years ago.

Download all attachments as: .zip

Change History (10)

#1 @pento
10 years ago

  • Component GeneralQuery
  • Keywords needs-docs added
  • Milestone Awaiting Review4.8
  • Severity normalminor
  • Type enhancementdefect (bug)
  • Version3.7

Also need to note that the default orderby changes from date to relevance when a search parameter is passed to WP_Query.

#2 @dots
10 years ago

Added 'relevance','type' to document in class-wp-query.php

@dots
10 years ago

@dots
10 years ago

@dots
10 years ago

Please ignore 39336.2.patch

#3 @dots
10 years ago

  • Keywords has-patch added; needs-patch removed

Please ignore 39336.2 patch and consider the 39336.3

#4 @boonebgorges
10 years ago

  • Keywords needs-docs removed

Thanks for the patch, @dots.

$relevance should not have its own top-level @param entry, as it's only a possible value for 'orderby'. Your patch also added an entry for $type, but as far as I can see, this is not a valid orderby parameter for WP_Query. Can you have a look at 39336.4.patch and see if it matches with your understanding?

#5 @dots
10 years ago

@boonebgorges Thanks for the correction. Now, I understand.

#6 @boonebgorges
10 years ago

  • Owner set to boonebgorges
  • Resolutionfixed
  • Status newclosed

In 39636:

Query: Improve documentation for orderby=relevance in WP_Query.

Props dots.
Fixes #39336.

Note: See TracTickets for help on using tickets.