[wp-trac] [WordPress Trac] #35192: Comments_clauses filter
WordPress Trac
noreply at wordpress.org
Sun Jan 10 17:56:41 UTC 2016
#35192: Comments_clauses filter
--------------------------+--------------------
Reporter: firebird75 | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: 4.4.2
Component: Comments | Version: 4.4
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
--------------------------+--------------------
Comment (by firebird75):
Hello Boonebgorges!
Thanks a lot for your outstanding support!
So few remarks about those changes :
1/ All the SQL errors I had are now gone away, nice!
2/ I get way more comments than I was without this fix through the query
but there is still one case which this fix doesn't address and that I am
only able to address by adding this filtering clause :
{{{#!php
<?php
$clauses['where'] = str_replace('AND comment_parent =
0','',$clauses['where']);
}}}
Basically, this is this case :
- Comment A (level 0)
- Comment B (Level 1, ie reply to A)
- Comment C (Level 2, ie reply to B)
If I set B to be a comment which isn't available to all users through my
filters, then C will disappear as well, even if it isn't set to be
unavailable to all users. I guess this is because the hierachy is somehow
broken somewhere in the functions because I had removed B. I am able to
workaround that with this code addition in my filtering function but then
comment C isn't showing as being nested comment :
{{{#!php
<?php
$clauses['where'] = str_replace('AND comment_parent =
0','',$clauses['where']);
}}}
Anyway, even if the fix isn't complete. It is already a pretty good step
as it addresses the SQL error and most of the missing comments.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35192#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list