I’ve created a custom post type for my “Testimonials”, I don’t need a title(s), how can I write a function that Adds the “Edit | Quick Edit | Trash | View” links to “date” if title isn’t shown in the column.
I’m using the plugin “Admin Columns” to hide the columns I don’t wish to show.
I’m trying to re-use this code from this previous StackExchange question ( No Edit / Delete Links for Custom Post Type? ), however I have already created the fields “Author” etc.
Using this code gives this result.
This is not easily done as there is no hook to add the rows actions. You can however, unregister the date column and re-register your own date column with the row actions added. A bit hacky unfortunately.
I have tried to ensure that the following code is for post type ‘testimonials’
First register your new date column and unregister the old: (use
manage_{post_type}_posts_columns
hook)Then make your new date column sortable, (by ‘date’). Use
manage_edit-{post_type}_sortable_columns
hook)Now comes the fun bit – displaying the content of the column. I have pretty much copied and pasted what WordPress does to fill the date column and then added the actions onto the end.
Use
manage_{post_type}_posts_custom_columns
hook)I know this thread is old, but i add a better answer working since WordPress 4.3. You can use a filter to assign the primary column of the table. For this solution you need to know the Post Type, and the column ID (inspect the html with your browser to find it).
In my example the post type is “event” (so the variable $screen is “edit-event”), and the column is a custom taxonomy “event-places” (WP is calling the column “taxonomy-event-places”).