Make WordPress Core

Opened 10 years ago

Last modified 5 years ago

#29320 reopened enhancement

Bulk edit on custom post types without title support

Reported by: alexfecke's profile alexfecke Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.9.2
Component: Quick/Bulk Edit Keywords: needs-patch
Focuses: administration Cc:


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)

bulk_edit.png (15.5 KB) - added by alexfecke 10 years ago.

Download all attachments as: .zip

Change History (6)

#1 @helen
10 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed
  • Type changed from defect (bug) to enhancement

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.

10 years ago

#2 @alexfecke
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.

#3 @SergeyBiryukov
10 years ago

  • Milestone set to Awaiting Review
  • Resolution wontfix deleted
  • Status changed from closed to reopened

We should do something like [24560] and [27360] here.

#4 @chriscct7
8 years ago

  • Keywords needs-patch added
Note: See TracTickets for help on using tickets.