I check the source in wp-includes/comment.php and print the sql and run it in phpmyadmin. If use borderby comment_ID ,it will cause sql error: #1052 - Column 'comment_ID' in order clause is ambiguous
After check the source I thing this is a bug in wp_comment_query’s query builder. It should add tablename before orderby fields.
The topic ‘use get_comments with orderby comment_ID not work’ is closed to new replies.
(@semonxue)
10 years, 3 months ago
In my project, When I use get_comments with orderby comment_ID. WP will always return nothing.
my code like:
I check the source in wp-includes/comment.php and print the sql and run it in phpmyadmin. If use borderby comment_ID ,it will cause sql error:
#1052 - Column 'comment_ID' in order clause is ambiguous
After check the source I thing this is a bug in wp_comment_query’s query builder. It should add tablename before orderby fields.