Here you go!
add_filter( 'code_snippets/list_table/columns', function ( $columns ) {
return [
'cb' => $columns['cb'],
'id' => $columns['id']
] + $columns;
} );I believe that initially I chose this column order as it felt strange to not have the ‘name’ column, with all of the snippet actions, as the first column in the table next to the checkbox. I can definitely see the use-case for having ‘ID’ first, and given that it starts as hidden, there’s definitely an argument to be made that this could be a sensible default.
Hi @bungeshea,
Thank you for your quick response. Works great!
If you don’t mind, can you also provide one that moves the Priority column from (now) last to the second column (to the right of the ID column)?
Argument: Think of your main code snippets display page as a spreadsheet, where we can quickly sort and find our code snippets by key identifiers (i.e., by ID and criticality or “Priority” for quick viewing and modification). Also, the UI is a lot nicer 🙂
We’ll close this topic as “Resolved” once we hear back from ya.
Thank you!
Hi @bungeshea,
Never mind. We figured it out. See below.
Thank you!
————–
add_filter( 'code_snippets/list_table/columns', function ( $columns ) {
return [
'cb' => $columns['cb'],
'id' => $columns['id'],
'priority' => $columns['priority']
] + $columns;
} );
