Skip to main content
added 22 characters in body
Source Link
Pieter Goosen
  • 55.4k
  • 23
  • 115
  • 209

Here is what I do to sort my custom post type by custom taxonomy in the admin. I have a custom post type called plugin_filter and a custom taxonomy assigned to it called filter_group. I add the following filter to my plugin to make the field sortable.

add_filter("manage_edit-plugin_filter_sortable_columns", 'plugin_filter_sort'); function plugin_filter_sort($columns) { $custom = array( 'taxonomy-filter_group' => 'taxonomy-filter_group' ); return wp_parse_args($custom, $columns); }

add_filter("manage_edit-plugin_filter_sortable_columns", 'plugin_filter_sort');
function plugin_filter_sort($columns) {
   $custom = array(
       'taxonomy-filter_group' => 'taxonomy-filter_group'
   );
   return wp_parse_args($custom, $columns);
}

Here is what I do to sort my custom post type by custom taxonomy in the admin. I have a custom post type called plugin_filter and a custom taxonomy assigned to it called filter_group. I add the following filter to my plugin to make the field sortable.

add_filter("manage_edit-plugin_filter_sortable_columns", 'plugin_filter_sort'); function plugin_filter_sort($columns) { $custom = array( 'taxonomy-filter_group' => 'taxonomy-filter_group' ); return wp_parse_args($custom, $columns); }

Here is what I do to sort my custom post type by custom taxonomy in the admin. I have a custom post type called plugin_filter and a custom taxonomy assigned to it called filter_group. I add the following filter to my plugin to make the field sortable.

add_filter("manage_edit-plugin_filter_sortable_columns", 'plugin_filter_sort');
function plugin_filter_sort($columns) {
   $custom = array(
       'taxonomy-filter_group' => 'taxonomy-filter_group'
   );
   return wp_parse_args($custom, $columns);
}
Source Link

Here is what I do to sort my custom post type by custom taxonomy in the admin. I have a custom post type called plugin_filter and a custom taxonomy assigned to it called filter_group. I add the following filter to my plugin to make the field sortable.

add_filter("manage_edit-plugin_filter_sortable_columns", 'plugin_filter_sort'); function plugin_filter_sort($columns) { $custom = array( 'taxonomy-filter_group' => 'taxonomy-filter_group' ); return wp_parse_args($custom, $columns); }