• Hello! A few years in my functions.php was written this mod:

    if (! function_exists ('iweb_reverse_comments')) {
    ????function iweb_reverse_comments ($ comments) {
    ????????return array_reverse ($ comments);
    ????}
    }
    add_filter ('comments_array', 'iweb_reverse_comments');

    This allowed me to display the comments in reverse order:
    Page 1:
    Most new comment
    ….
    Page 10:
    The oldest comment

    After upgrading to WordPress 4.4 this code stopped working (it worked fine on version 4.3) and WordPress now displays on the first page oldest comments:

    Page 1:
    The oldest comment
    ….
    Page 10:
    Most new comment

    Discussion Settings in an administrative panel does not help.
    If this function can not be converted to work with WordPress 4.4 – who can tell where I can change the query that selects comments and add the ‘ORDER BY comment_id DESC’?

Viewing 1 replies (of 1 total)
  • Thread Starter dim565

    (@dim565)

    I found a temporary solution:
    wp-includes/comment-template.php
    Line 1285

    $comment_args = array(
    'orderby' => 'comment_date_gmt',
    'order' => 'ASC'

    Change To DESC.

    If someone can write new code to use in functions.php I will be grateful!

Viewing 1 replies (of 1 total)
  • The topic ‘array_reverse stopped working in WordPress 4.4’ is closed to new replies.