Skip to content

Commit

Permalink
List newly submitted bots first in the admin.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanbohacek committed Apr 13, 2021
1 parent 65762fc commit f4a3c43
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -684,3 +684,11 @@ function bw_add_robotstxt( $robots ){
}

add_action( 'do_robotstxt', 'bw_add_robotstxt', PHP_INT_MAX );

function bw_admin_reorder_posts( $query ){
if ( is_admin() && $query->is_main_query() && $_GET['post_type'] === 'bot' ) {
$query->set( 'order', 'DESC' );
}
}

add_action( 'pre_get_posts', 'bw_admin_reorder_posts' );

0 comments on commit f4a3c43

Please sign in to comment.