Post list in admin (edit.php) use a normal WP_Query, just like frontend can be changed using pre_get_posts.
add_action('pre_get_posts', 'reorder_my_cpt');
function reorder_my_cpt( $q ) {
if ( !is_admin() || !$q->is_main_query() ) {
return;
}
$s = get_current_screen();
// change 'book' with your real CPT name
if ( $s->base === 'edit' && $s->post_type === 'book' ) {
$q->set('orderby', 'menu_order');
$q->set('order', 'ASC');
}
}
Related Posts:
- How to add an admin notice upon post save/update
- How to Change Order of Posts in Admin?
- Different post sort order within different categories
- Change label of title field for posts in the backend
- what types of order can I pass to get_posts() via orderby?
- Sort posts by popularity/page views
- How to Arrange Posts by Size in the WordPress Dashboard?
- Sort post by attributes ‘order’
- Open WordPress ‘Add New Post’ admin page with parameters set via $_GET
- How to sort posts by last name (2nd word) on ONE category only?
- Query posts from current year
- Categories box not showing on post edit pages
- Increment Page Order As Pages Are Created
- Include Sticky Post in Page Posts Count?
- Set number of article per number of page
- Make “Post published. View post” Open in a New Tab
- How to choose a sort order (for posts) per category? (ideally when creating a new category)
- How to get new post URL?
- Display custom post types by date field
- Add confirmation popup on “Move to Trash”
- Embed WordPress Admin in an iframe
- Can’t publish, edit or delete posts since Gutenberg update
- Add filter-by-tag in the all posts admin console page
- Remove some articles from the list in WPAdmin for a user
- How do I allow users to follow a post and then allow admins to email all users who have followed that post?
- display list of posts/pages in admin edit post/page
- orderby=meta_value_num creates duplicate posts
- Custom Theme Want To Remove One Category From All Displays
- Invalid post type when click “Filter” or “Apply” button in WordPress admin Post list [closed]
- How to change the title url on the edit post screen?
- Display posts in alphabetical order for a particular category
- post re-order on my site
- Why orderby=”date” does not support manually changed posts?
- How can I sort posts by the date and a custom meta field?
- WordPress’ ALL post count info on its dashboard does not match phpMyAdmin’s ALL post count!
- Classic editor throws 403 error based on post content
- Sort WP posts by span value
- Display Meta Values in Custom Filter – Admin Custom Posts
- How to sort posts inside categories
- Lost draft under all posts and drafts
- Any way for get_next_post() to use the actual post order instead of publish order?
- Simultaneous admin updates causes custom fields to not update
- Hook in to add new post link wp admin?
- Custom order for Mysql array
- How to order posts by meta_value and title
- Order posts alphabetically: how to set order=asc in mysql query?
- How Do I Get My Post Tags to Alphabetize?
- While loop articles – if statement order
- Retrieve only posts from a specific user in wp-admin/edit.php
- Adding an Archive button to posts page for administrators
- Develop Admin Panel Page
- How show categories in admin and get that selected to show posts in index
- Change post-slug using wordpress API? Change permalink of a post using php / jquery?
- Create a list of posts with topic headdings
- Fast publishing in wordpress
- Which file do I need to edit the All Posts page in the admin area?
- How can I add a box to edit Order on a regular post?
- How do you search for a post or page with a certain url on the WordPress admin panel?
- Change the default blog post post attribute template name from “default template” to something else
- Change the color of the Password Protected Post titles
- Bolding several words at once
- get_previous_post() while accounting for sticky posts
- Need to know custom code to display random and most viewed posts in wordpress posts and pages
- List latest posts with least comments in WP-Admin
- Order posts by date
- WP_Query outputs wrong post in custom post type
- Cannot create new posts or upload images using media manager
- ‘QTags.addButton: arg2 distorts the button rather than just shows
- My page shows some other content in WP
- the wp_post_update isn’t working all the time
- Redirect old Posts URL to new URL
- Blog open in new Tab
- query posts with selected post ids first
- Remove status ‘archived’ from the default post and page view
- WordPress Screen Options, Help, Visual editor, Status, Visibility, Revisions, Published on and any toggled indicator don’t work for posts
- Redirecting to “All Posts” after post publish or update
- How do I display posts ordered by a date custom field?
- WP_Query sort by meta_value_num or date
- Set featured image on creating new post
- Blank page after changing number of post displayed in wp-admin
- Allow reader to reorder posts for themselves (oldest first)
- How to sort posts in admin by name
- How can I filter the post of a CPT by taxonomy Term in admin meta-box dropdown?
- issue in wordpress auto delete post and redirect to another 1
- How to enable comments meta box for other author posts?
- Post preview in iframe without saving the post
- How to change the publishing date of each posts?
- Last three posts not being put in order by date. How to fix this?
- Error establishing a database connection
- Order by ‘s’ using WP_Query()
- Creating a new Sortable Column in WordPress Admin
- Enqueue CSS on custom posts’ backend area
- What does WordPress mean by they have full rights to content [closed]
- Add News Feed to bespoke website, only to one page on whole site
- Post Format Status [closed]
- Custom Admin Post Column change order
- Display posts with id equal to relationship value
- I cannot see the pagination in /wp-admin posts page
- How to sort posts alphabetically based on a specific parent category
- Mismatch between posts count and actual list in admin posts page