Title: array_reverse stopped working in WordPress 4.4
Last modified: August 30, 2016

---

# array_reverse stopped working in WordPress 4.4

 *  [dim565](https://wordpress.org/support/users/dim565/)
 * (@dim565)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/array_reverse-stopped-working-in-wordpress-44/)
 * 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](https://wordpress.org/support/users/dim565/)
 * (@dim565)
 * [10 years, 5 months ago](https://wordpress.org/support/topic/array_reverse-stopped-working-in-wordpress-44/#post-6834290)
 * 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.

## Tags

 * [Comments](https://wordpress.org/support/topic-tag/comments/)
 * [order](https://wordpress.org/support/topic-tag/order/)
 * [reverse](https://wordpress.org/support/topic-tag/reverse/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [dim565](https://wordpress.org/support/users/dim565/)
 * Last activity: [10 years, 5 months ago](https://wordpress.org/support/topic/array_reverse-stopped-working-in-wordpress-44/#post-6834290)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
