[wp-trac] [WordPress Trac] #30354: get_posts_by_author_sql doesn't also return prefixed where is asked to
WordPress Trac
noreply at wordpress.org
Mon Nov 17 13:07:58 UTC 2014
#30354: get_posts_by_author_sql doesn't also return prefixed where is asked to
--------------------------------------+------------------------------
Reporter: pbearne | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Query | Version: trunk
Severity: normal | Resolution:
Keywords: has-unit-tests has-patch | Focuses: administration
--------------------------------------+------------------------------
Comment (by pbearne):
Thinking about this an example of the bad out put might help
if you call
get_posts_by_author_sql( 'page' ); or get_posts_by_author_sql( 'post',
true );
which the same with the default
you get this string
"WHERE post_type = 'post' AND (post_status = 'publish')"
But if you call get_posts_by_author_sql( 'post', false ); which set the
$full to false and not return the "WHERE" you get
" (post_status = 'publish')"
not
" post_type = 'post' AND (post_status = 'publish')"
as you would expect
this was due to a bad path in the $full route
I hope this ticket makes more sense now
Paul
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30354#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list