Changes between Initial Version and Version 1 of Ticket #55287
- Timestamp:
- 09/11/2025 11:07:16 PM (3 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #55287
-
Property
Version
changed from
6.0to -
Property
Component
changed from
Posts, Post TypestoQuery
-
Property
Version
changed from
-
Ticket #55287 – Description
initial v1 2 2 3 3 Currently I'm working with a plugin to create designs. 4 This plugin has an element called a repeater element that basically makes use of the core WP_Querymethod in order to fetch custom post types or normal post types.4 This plugin has an element called a repeater element that basically makes use of the core `WP_Query` method in order to fetch custom post types or normal post types. 5 5 6 However, since I'm using this page builder or theme builder, I am in no way capable of using DISTINCTwithin the filter https://developer.wordpress.org/reference/hooks/posts_distinct/7 Because this requires me to send the WP_Queryinstance, which is basically only used within the repeater element and can not be set to a variable in this particular case.6 However, since I'm using this page builder or theme builder, I am in no way capable of using `DISTINCT` within the filter https://developer.wordpress.org/reference/hooks/posts_distinct/ 7 Because this requires me to send the `WP_Query` instance, which is basically only used within the repeater element and can not be set to a variable in this particular case. 8 8 9 9 This means I'll have to rebuild everything through code, instead of being able to use my page or theme builder. 10 10 11 11 Now I get the idea of saying this is a bug with the page or theme builder plugin. 12 But in fact, what I want to know is why are we using a filter to create a DISTINCT query inside of WP_Query? Isn't it possible to implement this inside of the WP_Query arguments instead? I basically want to say: fetch posts with unique titles. This seems much more logical as the SQL query is build from WP_Query...12 But in fact, what I want to know is why are we using a filter to create a `DISTINCT` query inside of `WP_Query`? Isn't it possible to implement this inside of the `WP_Query` arguments instead? I basically want to say: fetch posts with unique titles. This seems much more logical as the SQL query is build from `WP_Query`... 13 13 14 14 I've already looked through the entire codex, and couldn't find any possible parameter that could be used for this... 15 15 16 My question to you is: Can this please be added to wordpress core?17 I find it highly frustrating that WP_Querydoesn't have this sort of capabilities out of the box.16 My question to you is: Can this please be added to WordPress core? 17 I find it highly frustrating that `WP_Query` doesn't have this sort of capabilities out of the box.