You are trying to sort by “x” but WordPress doesn’t know what that is. So you either need to sort by something WP understands like “title”:
$columns['MY_CUSTOM_COLUMN'] = 'title';
Otherwise you need “x” to actually do something like such:
function my_custom_query_sort( $query ) {
if ( ! is_admin() ) {
return;
}
$orderby = $query->get( 'orderby');
if ( 'x' == $orderby ) {
$query->set( 'orderby', 'SOMETHING CUSTOM' );
}
}
add_action( 'pre_get_posts', 'my_custom_query_sort' );
But that’s not the only issue…You mention the column is a custom taxonomy. There isn’t any core function in WordPress to sort posts by taxonomy. Not to mention that each post could have multiple terms assigned to them.
Related Posts:
- New post status for custom post type
- Adding Custom Post Type Counts to the Dashboard
- How can I filter posts by post_parent in the admin?
- Get Custom Taxonomy ID within loop
- Rewriting ‘rewrite’ slug for custom post type used by plugin
- Using Templates with Custom Post Type UI
- WordPress Custom Post Type Admin Page really slow
- How to setup a Custom Taxonomy Term template
- Creating a gallery of featured images from custom post type
- Taxonomy terms with edit/filter link in wp-admin, in the list of custom posts
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- How to add meta boxes(repeater fields) from WordPress back end?
- Custom post type: No posts found even if counter has a count
- Admin List Dynamic Heading
- ‘category__and’ for custom taxonomy?
- Custom field default value with counter
- WP_Query and using a variable for ‘cat’=> in the args array = WP Bug?
- Custom post query by taxonomy
- Create second custom 404 page for selected post type
- Warning when attempting to edit/add custom post type
- Sub-Sub-Blogs — creating and importing content into a custom sub-type
- Check if a specific custom field exists?
- How does register_post_type know how and which function to use from the add_action function?
- WordPress Create Post from front-end
- Custom post type with slug for plural (archive) and for single
- Change Featured Image / Thumbnail CMS Description
- add custom field to custom post type
- How to convert custom post type based list to a dropdown list?
- Custom Taxonomy Archives on Custom Post type Page [duplicate]
- Custom post type search using $_SESSION and pre_get_posts
- On update or create post redirect to current post position in list
- read_post meta capability for anonymous users
- Custom template Page 2 not working
- custom post type pagination error 404
- Problems with image size on the server WordPress
- Search by tag name and category
- get_the_title() is returning results from previous loop
- Moving meta boxes in admin
- Can we create a custom post template for a specific page template
- Why is get_pages() returning a boolean?
- Post-thumbnail only for specific post-types?
- 3 random images from custom post type, each in a div with a diffrent class
- get_category_link() for custom post type does not include custom slug rewrite?
- make permalink go to a custom single.php file
- Make custom post meta sortable front end
- Shortcode leaves no space for other elements?
- Conflict between wp_list_pages and get_posts – list pages not displaying
- How to make a pulldown menu display custom meta terms in a theme?
- Show All Custom Post Types On A Single Archive Page
- Show message when query has no posts
- Get category if used in a custom post type
- Custom Search | check multiple meta_value for search value
- Foreach loop returning more than one item when querying taxonomy
- Change the properties of a custom post type after it’s been registered?
- Limit search field to just search a custom post type with custom fields
- Meta box with front-end styling
- Most viewed post of custom post type
- How to enable parent-child relationships and post attribute admin widget for posts
- Order Custom Post Type Archive by multiple values in functions.php
- Organize Existing Posts from the Admin Area to a New Category
- Manually adding or updating CPT automatically sets post_status of future
- Images not load on custom post type sidebar, related posts
- Custom post type page with parameter
- Previous / Next Links For Custom Post Type Sorted By Meta_Value
- Filling custom post type posts from a rest api
- Get category name of custom post type
- Tags being removed upon updates to related posts: ACF/Genesis/WP5.4.1
- Custom post shows 404 after theme change
- Show date as permalink for custom post type instead of post name
- Custom Post type shortcodes
- Pagination for a cpt filtered with a category
- How do I force a CPT to select a shared custom template in Post Attributes?
- assign array of category to custom post type
- Adding specific custom fields (images) to post excerpt
- filter using custom fields
- Filter before manage_posts_custom_column
- How to manage a dynamic multi-level page hierearchy system?
- Change permalink incrementor into pseudo-subdirectory
- Create unordered list from custom field type entires separated by a comma
- Custom Fields with add_post_meta()
- How to create groups like that in buddypress?
- Custom meta box data not saving
- Custom post type rewrite and wp_pagenavi interfering with each other
- Include template if a post is a single product
- WordPress loop, show only one post per custom field
- Getting list of Categories for Custom Post Types
- Adding Information To All Posts Screen
- Custom meta-box for all custom post types
- Retrieve a specific category of posts when using a custom post type
- General question about Parent and Child Post type relationships
- WordPress Load more posts by ajax not working
- Multiple while loops not functioning [closed]
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Ideal top-level slug methods
- How to write an if statement which reads: ‘if is this custom post type or a child of it do the following’?
- taxonomies or categories w/custom post
- Require Custom Taxonomy for Custom Type
- Post count for particular term
- Get post from custom post type that title is like custom string [closed]
- post__in select all custom posts and not the selected array of ids