Opened 7 years ago
Closed 7 years ago
#45349 closed enhancement (reported-upstream)
Use WP_Query in render_block_core_latest_posts()
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 5.0 |
| Component: | Posts, Post Types | Keywords: | |
| Focuses: | Cc: |
Description
Add a filter so that plugins and themes can filter the arguments.
Why is this needed:
Plugins may want to filter arguments in some situations. Eg. WPML will need to display posts in the current language only.
Attachments (1)
Change History (8)
#1
@
7 years ago
- Component changed from General to Posts, Post Types
- Keywords reporter-feedback added; has-patch removed
- Severity changed from major to normal
- Type changed from feature request to enhancement
#2
@
7 years ago
We have a more general solution proposed in https://github.com/WordPress/gutenberg/pull/11730 which should resolve this ticket.
#4
@
7 years ago
- Milestone changed from Awaiting Review to 5.0.1
- Summary changed from wp_get_recent_posts() Add filter for $args to Use WP_Query in render_block_core_latest_posts()
Gutenberg PR: https://github.com/WordPress/gutenberg/pull/11984
Note: See
TracTickets for help on using
tickets.
Hi @sergey.r, welcome to WordPress Trac! Thanks for the ticket.
Wouldn't the existing
pre_get_postsfilter be sufficient for that? It runs onwp_get_recent_posts()as well.