Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$post->comments() function ignores WP's comment order. #1731

Closed
kiiraklis94 opened this issue Jun 19, 2018 · 3 comments
Closed

$post->comments() function ignores WP's comment order. #1731

kiiraklis94 opened this issue Jun 19, 2018 · 3 comments

Comments

@kiiraklis94
Copy link

Expected behavior

In the docs it say that the comments function takes an $order parameter.
Default is "wp" which it says is meant to use the wordpress option found in settings>discussion.

Actual behavior

I've set this everything from 'wp' to 'wordpress' and even tried 'asc' and 'desc' but nothing seems to work. It just ignores it and displays the comments with the older comments on the top.

What version of WordPress, PHP and Timber are you using?

WordPress 4.9.6, PHP 7.2, Timber 1.7.1

How did you install Timber? (for example, from GitHub, Composer/Packagist, WP.org?)

Composer

@alicam
Copy link

alicam commented May 9, 2019

This FIX for this is to change CommentThread.php, line 45. From:

return array_merge($base, $args, $overrides);

to

return array_merge($base, $args);

In other words, there is currently a forced override of the comment ordering.

Why?!

@jarednova
Copy link
Member

Thanks @alicam! I've applied your suggested fix in #2015

jarednova added a commit that referenced this issue Jun 18, 2019
ref #1731 -- apply suggested fix for comment order override
@jarednova
Copy link
Member

Closed by #2015 — release coming soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants