#40229 closed enhancement (fixed)
Add meta_query to wp_site_query
Reported by: | spacedmonkey | Owned by: | flixos90 |
---|---|---|---|
Milestone: | 5.1 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Networks and Sites | Keywords: | ms-roadmap needs-patch has-dev-note |
Focuses: | multisite | Cc: |
Description
Currently site query doesn't support meta query as there is no blogmeta table. However with it being added #37923 this functionally can be supported.
Along with adding support this functionality, we should start to use it in a number of place. A key example is adding the ability to search by site title in the network admin panel
Attachments (1)
Change History (21)
This ticket was mentioned in Slack in #core-multisite by spacedmonkey. View the logs.
3 years ago
#3
@
3 years ago
- Keywords needs-patch needs-unit-tests added
- Milestone changed from Awaiting Review to 4.9
- Owner set to spacedmonkey
- Status changed from new to assigned
#4
@
3 years ago
- Keywords ms-roadmap added
These tickets belong to our planned roadmap (a few of them not per final decision), so flagging with a keyword for better overview.
This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.
3 years ago
This ticket was mentioned in Slack in #core-multisite by flixos90. View the logs.
2 years ago
#10
@
2 years ago
- Keywords has-patch has-unit-tests added; needs-patch needs-unit-tests removed
- Owner changed from spacedmonkey to flixos90
40229.diff implements meta query functionality in WP_Site_Query
:
- The implementation itself is trivial and straightforward. It follows mostly how other query classes do it. The orderby-meta functionality deserves an extra look because it's the most complicated part, but the provided tests confirm it works as expected.
class-wp-meta-query.php
is loaded earlier inwp-settings.php
to allow this functionality early during the multisite bootstrap process. This will fix #40948.- Comprehensive tests have been added for the meta query functionality, i.e. one parameterized test with 10 datasets, each testing different behavior.
- Three additional tests have been added to verify that adding/updating/deleting site meta busts the site query cache.
#14
@
2 years ago
@flixos90 I believe you need to put some clean_blog_cache
/ wp_cache_set( 'last_changed', microtime(), 'sites' );
calls into add_site_meta
, update_site_meta
and delete_site_meta
.
Otherwise meta queries will not be invalidated.
#16
@
18 months ago
- Milestone changed from 5.0 to 5.1
- Resolution fixed deleted
- Status changed from closed to reopened
Version numbers need to be adjusted to 5.1.0.
I suggest continuing with the site meta query functionality in #37923 for now, as we would like to work on the entire site meta feature in the format of a feature project (hosted at https://github.com/jeremyfelt/wordpress-develop).
When we get to committing, it probably makes sense to break things down to smaller parts, and then this sub-ticket here can come in handy. For now let's keep the discussion going in a centralized location (#37923).