最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to sort custom columns for custom post type without meta query and pre_get_posts?

programmeradmin0浏览0评论

I have a custom post type orders and multiple custom columns. I've added the custom columns with the manage_orders_posts_columns hook and registered the columns as sortable with this hook: manage_edit-orders_sortable_columns.

My issue is that some of the column values are not simply meta fields; the info displayed in these columns is generated based on multiple conditions related to custom functionality.

So my question is: is there any way to make a custom column sortable other than using the pre_get_posts hook and modifying the query?

发布评论

评论列表(0)

  1. 暂无评论