WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 8 months ago

#39336 closed defect (bug) (fixed)

Document WP_Query orderby=relevance

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

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 8 months ago.
39336.2.patch (2.0 KB) - added by dots 8 months ago.
39336.3.patch (2.0 KB) - added by dots 8 months ago.
Please ignore 39336.2.patch
39336.4.patch (1.9 KB) - added by boonebgorges 8 months ago.

Download all attachments as: .zip

Change History (10)

#1 @pento
8 months ago

  • Component changed from General to Query
  • Keywords needs-docs added
  • Milestone changed from Awaiting Review to 4.8
  • Severity changed from normal to minor
  • Type changed from enhancement to defect (bug)
  • Version set to 3.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
8 months ago

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

@dots
8 months ago

@dots
8 months ago

@dots
8 months ago

Please ignore 39336.2.patch

#3 @dots
8 months ago

  • Keywords has-patch added; needs-patch removed

Please ignore 39336.2 patch and consider the 39336.3

#4 @boonebgorges
8 months 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
8 months ago

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

#6 @boonebgorges
8 months ago

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

In 39636:

Query: Improve documentation for orderby=relevance in WP_Query.

Props dots.
Fixes #39336.

Note: See TracTickets for help on using tickets.