WordPress.org

Make WordPress Core

Opened 4 years ago

Last modified 3 years ago

#29320 reopened enhancement

Bulk edit on custom post types without title support

Reported by: alexfecke Owned by:
Milestone: Awaiting Review 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)

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

Download all attachments as: .zip

Change History (5)

#1 @helen
4 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.

@alexfecke
4 years ago

#2 @alexfecke
4 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. https://core.trac.wordpress.org/raw-attachment/ticket/29320/bulk_edit.png

#3 @SergeyBiryukov
4 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
3 years ago

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