Sortable Order Column for Pages
Shows the page order (menu_order) value in the Pages list and lets you sort by it.
Opens WPIDE on
Code
add_filter( 'manage_page_posts_columns', function ( $columns ) {
$columns['wpide_menu_order'] = 'Order';
return $columns;
} );
add_action( 'manage_page_posts_custom_column', function ( $column, $post_id ) {
if ( 'wpide_menu_order' === $column ) {
echo (int) get_post_field( 'menu_order', $post_id );
}
}, 10, 2 );
add_filter( 'manage_edit-page_sortable_columns', function ( $columns ) {
$columns['wpide_menu_order'] = 'menu_order';
return $columns;
} );
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.