You can set $_GET
directly inside your pre_get_posts
action to get the UI to pickup that change:
function wpd_test_pre_get( $query ) {
// put whatever conditions to target your cpt here
if( is_admin() && $query->is_main_query() ){
// modify query
$query->set('orderby', 'title');
$query->set('order', 'asc');
// set $_GET vars
$_GET['orderby'] = 'title';
$_GET['order'] = 'asc';
}
}
add_action( 'pre_get_posts', 'wpd_test_pre_get' );
Related Posts:
- Load a script just to custom post type in admin
- Placing a Custom Post Type Menu Above the Posts Menu Using menu_position?
- Loading External Scripts in Admin but ONLY for a Specific Post Type?
- Showing User’s Post Counts by Custom Post Type in the Admin’s User List?
- Merge two custom post types into one admin page?
- Remove the “View” Link in Post Admin
- Add “Last Edited by” column to custom post type list table
- Filter custom post types in admin not working
- Custom post type admin search
- Ordering posts by custom taxonomy in admin area
- Create a dropdown with Custom Post Types as option in admin
- How to add custom columns to Custom Post Type admin screen
- How to Make an admin_notices Message That Disappears Once the User Leaves That Particular Page?
- Prevent reload confirmation after AJAX save
- jQuery UI in Admin (Best Practice?)
- Admin Post Update Redirection to Posts Screen
- Exclude add_filter from the admin
- Custom Post type sort order not working in the admin area
- Custom admin columns for ALL custom post types
- Add custom column to custom post type overview in backend
- Unable to filter on field on edit.php page
- How to Change the Title of a Meta Box on a Specified Custom Post Type? [duplicate]
- No results searching custom post type in admin panel
- How to add post_author column to custom post type
- Adding help information to custom post edit page
- Only Show an Author Their Custom Post Types
- Custom Post Type and taxonomies’s labels localization not working
- How can I add a column in the wp_list_table of the admin area?
- Show admin help message across custom post type parent and child posts
- How to show custom (checkbox) field value in admin post list?
- Settings page above CPT page in admin section
- How to search CPT’s by meta query from the admin dashboard?
- Add theme options to custom post type admin pages [closed]
- Using WPAlchemy metabox values in another metabox
- Custom post admin filtering by post meta (the date)
- Admin Column Text Positioning
- Add text to wordpress admin ‘Add Post’ edit
- Sort admin area by custom Event Date field
- How can I change the title of an Add New page in Admin for custom post type
- How to customize admin posts based on the user who is logged in
- Set a default category – if the user didn’t select one- before creating a post
- Add html to cpt main page / admin edit.php
- How can I create a custom meta box to add an mp4 video to a page?
- Is there a way to have the view link on manage posts page to open in a new window or tab?
- How to only show posts assigned to current user, only in certain post types
- Add acf field in title (admin table)
- Adding HTML tags or css classes to admin columns
- Create a page that will be used to create a custom post type
- Customize my custom taxonomy table in Admin panel
- Get parse_query filter to return slug instead of id
- Custom Post Type Nav to Subpage
- Selecting a post in Dashboard
- Custom admin post.php page
- A simple script to allow sorting of custom posts in admin?
- Notify admin on new submit
- Options page – dropdown of users
- No Permission to add new Page, Post or CPT with Admin role
- Admin Column does not populate with data
- Filtering posts list table
- CPT Validation to not show “Post updated.”
- Custom post type isn’t working
- Use remove_meta_box conditionally on custom post type
- New “Custom Types” item in admin menu. Is this a plugin or a new wordpress feature?
- How to group navigation items in the admin panel
- Sortable column containing numeric values for Custom Post Type at WordPress Backend
- How to check if post/page or taxonomy post is published by admin
- CPT Columns doesn’t show categories
- Insert Custom Post Types
- sortable columns for multiple custom post types not working
- Custom Post Type – Support “author” only for admins
- Showing User’s Post Counts by Custom Post Type in the Author.php?
- Add ‘page template’ column to dashboard for CPTs
- Filter posts of custom post type by meta key in (List All Section)
- get_post_types not working properly in admin
- Is there a hook between clicking on “Add new” and the edit screen of a new post?
- Function to add custom HTML into head in custom post-type list page
- Multiple custom post types on same admin page
- WordPress admin for a custom post, hide/collapse the main “title” and “description” boxes
- Metaboxes inside Tab
- How can I put content before my custom post type default pages?
- How we can create menu from Appearance > Menu and use as a add-submenu-page for admin menu?
- Is there any filter to add a custom attribute to the tag in admin panel?
- How to hide private posts even if user is admin
- Help Adding filter to Add Media button for custom post type
- Delete all custom posts then upload a new CSV of events
- Pagination in wp-admin for CPT
- Custom post type doesn’t display on admin list
- Customising the admin columns for a custom post type, but now most of the built in categories don’t display?
- Shared Custom post type between WP network sites
- Exclude categories For Custom post types
- Admin menu post type
- WordPress Author Posts Review After Every Change In The Same WordPress Post
- Redirect preview single post link to a page
- Custom Post Type Causing Admin Sidebar UI Issue
- How to change the default orderby from “Date” to e.g. “Title” or my custom column in content type records list in admin?
- Change column of row action (Quick Edit) links in WP_List_Table
- Prevent users from changing post status
- Custom Plugin w/ Custom Post Types – Custom Posts Are Showing at all Privilege Levels – Is this possible to adjust?
- How to set the Screen Options for Users in the Admin Panel?
- Issue displaying multiple TinyMCE editors with WPAlchemy