0

I have 2 custom columns, typeconsole and console:

add_filter('manage_edit-post_sortable_columns', function( $columns ) { 
        $columns['typeconsole'] = 'typeconsole';
        $columns['console'] = 'console';
        return $columns;
});

This answer allows me to sort the first column: Make custom column sortable. When pressing the second column, the first one is ordered.

How do I make them work independently?

2
  • There is no sorting code in your question, can you edit it to include it? The original answer includes a pre_get_posts filter but yours does not
    – Tom J Nowell
    Commented Mar 2, 2021 at 23:37
  • Can you provide the code you're using the add and populate the columns as well?
    – phatskat
    Commented Mar 3, 2021 at 1:25

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.