Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #55287


Ignore:
Timestamp:
09/11/2025 11:07:16 PM (3 months ago)
Author:
sabernhardt
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #55287

    • Property Version changed from 6.0 to
    • Property Component changed from Posts, Post Types to Query
  • Ticket #55287 – Description

    initial v1  
    22
    33Currently 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_Query method in order to fetch custom post types or normal post types.
     4This 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.
    55
    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.
     6However, 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/
     7Because 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.
    88
    99This means I'll have to rebuild everything through code, instead of being able to use my page or theme builder.
    1010
    1111Now 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...
     12But 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`...
    1313
    1414I've already looked through the entire codex, and couldn't find any possible parameter that could be used for this...
    1515
    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.
     16My question to you is: Can this please be added to WordPress core?
     17I find it highly frustrating that `WP_Query` doesn't have this sort of capabilities out of the box.