WordPress.org

Make WordPress Core

Opened 5 months ago

Closed 5 months ago

#40196 closed enhancement (fixed)

Support querying sites by lang_id

Reported by: ocean90 Owned by: jeremyfelt
Milestone: 4.8 Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords: has-patch has-unit-tests commit
Focuses: multisite Cc:

Description

The wp_blogs table has a lang_id field and I don't see why we shouldn't support this field in WP_Site_Query.

WordPress.org has a separate table to store all locales with its data. By using WP_Site_Query we would benefit of the built-in query cache.

Attachments (2)

40196.patch (4.5 KB) - added by ocean90 5 months ago.
40196.2.patch (7.2 KB) - added by ocean90 5 months ago.

Download all attachments as: .zip

Change History (5)

@ocean90
5 months ago

#1 @spacedmonkey
5 months ago

Thanks for the patch. Can't believe we miss this. The only thing I would change is that I would also add lang_idin and lang_idnot_in to bring it inline with other params

@ocean90
5 months ago

#2 @ocean90
5 months ago

  • Keywords commit added

40196.2.patch adds lang__in and lang__not_in.

#3 @jeremyfelt
5 months ago

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

In 40340:

Multisite: Add lang_id support to WP_Site_Query.

Sites can now be queried by lang_id, lang__in, and lang__not_in.

Props ocean90.
Fixes #40196.

Note: See TracTickets for help on using tickets.