I have been working on a new plugin that utilizes the new Gutenberg, blocks editor. I wanted to change the order of the custom posts on the edit screen so that they are not ordered by name, as shown below.
Since the posts on the edit screen are displayed from wp_query I filtered pre_get_posts to set ‘orderby’ to date as shown below. To prevent all posts to be changed I only modify the query if it is one of my custom post types.
This ordered the post by date, but in Ascending order.
I could easily sort the posts from the date column but I wanted to have them in descending order by default. So I set ‘order’ to desc.
They are in descending order by default but you can not use the column sort to display the posts in the reverse order.