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
- Sort posts by popularity/page views
- How to Arrange Posts by Size in the WordPress Dashboard?
- How do I reorder (pop and push) items from WP_Query?
- using slug instead of ID in admin edit post url
- 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
- 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)
- Order post by year DESC and month ASC
- How to remove bulk edit options
- Add confirmation popup on “Move to Trash”
- Send email to user that his post has been rejected
- Add filter-by-tag in the all posts admin console page
- Remove some articles from the list in WPAdmin for a user
- 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
- Diplay comment date on WP_Post_Comments_List_Table
- Why orderby=”date” does not support manually changed posts?
- I am unable to publish/update post
- WP_Query orderby not working with meta_value_num and menu_order
- 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?
- Hook in to add new post link wp admin?
- Custom order for Mysql array
- How to order posts by meta_value and title
- plugin to post from admin to flickr [closed]
- Order posts alphabetically: how to set order=asc in mysql query?
- how to get post order by post id wp_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?
- Make a vertical dynamic list of posts in alphabetically order and in columns [closed]
- 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
- How to get the old WordPress Draft Editor view back with the Word count?
- Force a specific template as default
- 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
- Posts and order
- List latest posts with least comments in WP-Admin
- Lightbox on wordpress post page
- Adjust the order for returned posts
- Order posts by date
- WP_Query outputs wrong post in custom post type
- Automatic duplicate/copy of post to a related page in WordPress
- user_has_cap filter allows “edit_others_posts” but not is not allowing updating/publishing
- ‘QTags.addButton: arg2 distorts the button rather than just shows
- Redirect old Posts URL to new URL
- Blog open in new Tab
- query posts with selected post ids first
- Strange behaviour in WordPress admin
- 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?
- 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
- Random order of the 5 most popular posts
- My custom query is displaying random posts in random order
- Is it possible to display QUICK EDIT as default for all posts in wp-admin/edit.php page?
- Get query result according to merged array
- 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?
- 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]
- 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