Opened 10 years ago
Last modified 5 years ago
#29320 reopened enhancement
Bulk edit on custom post types without title support
Reported by: | alexfecke | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.9.2 |
Component: | Quick/Bulk Edit | Keywords: | needs-patch |
Focuses: | administration | Cc: |
Description
I have a custom content type that does not support titles. When I want to use bulk edit on this custom post type on edit.php, the area where the post titles should show up stays empty (instead of showing something like "auto draft").
This is due to includes/class-wp-posts-list-table.php:925 where it is checked whether the post type supports titles.
However I have a custom filter for the_title, which generates post titles dependent on custom fields. In order to let them show up in the bulk edit form, one would have to change for one class-wp-posts-list-table.php to allow post types without title support and one would additionally have to change includes/template.php:311 to use get_the_title($post->ID) instead of $post->post_title to insert the correct titles into the hidden fields in the edit.php-table.
Of course I could also store my custom titles in post_title and hide the title field from view in my custom post type, but I think this to be a rather hackish way...
Attachments (1)
Change History (6)
#1
@
10 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
- Type changed from defect (bug) to enhancement
#2
@
10 years ago
I don't want to change the title through bulk-edit, but if there is title support, the bulk edit view shows an overview over all posts that are included in the bulk edit – if the post type doesn't support titles, this field is empty (and my custom bulk edits don't work in that case, by the way). I attach two screenshots for clarification.
Hi, and thanks for the report. I'm not sure what your goals are - if it's preventing editing a generated title, then I'm not sure why you would want to show an editable field there. I would recommend registering the post type with support for the title and then removing support for title from the post type when on the edit screen. It's not hacky to store a title in the title field and then hide the UI for that field from users. Overall, I don't think it makes a lot of sense to show a field for something the post type is not declared to support.