Opened 2 years ago
Last modified 2 years ago
#16793 reopened defect (bug)
Bulk inline post edit doesn't show categories or tags if the CPT doesn't support titles
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Administration | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | israel@… |
Description
- Register a CPT that doesn't support titles:
add_action( 'init', function() {
register_post_type( 'foo', array(
'show_ui' => true,
'label' => 'Foo',
'supports' => array( 'editor' ),
'taxonomies' => array( 'category', 'post_tag' )
) );
} );
- Create a 'foo' post.
- Go to wp-admin/edit.php?post_type=foo and choose the 'Edit' bulk action.
Expected behaviour: shows the category checkbox list and the tag textarea.
Actual behaviour: only the status dropdown is shown.
Attachments (3)
Change History (11)
comment:1
markmcwilliams — 2 years ago
If you're using Chrome, without the patch, you should also be getting a JS error in the console:
Uncaught TypeError: Cannot read property 'firstChild' of null
Note that we're talking about the Edit option in the dropdown, not the quick action Edit link on each post.
comment:4
markmcwilliams — 2 years ago
OK so I was holding it wrong, I can confirm the initial error, and that the patch works! :)
- Resolution set to fixed
- Status changed from new to closed
Contrary to popular belief, $('some selector', context) is not faster than context.find('some selector'). It's just harder to read.
Also, there was a callback written twice, once for qeRow.keyup and again for bulkRow.keyup.
- Cc israel@… added
another casualty of this problem is that any javascript (and jQuery) that would be executed on the wp-admin/edit.php?post_type=foo screen can't run, as the javascript engine stops at that initial Uncaught TypeError: Cannot read property 'firstChild' of null error. I had been adding some additional sorting options via jQuery, and couldn't figure out why they appeared on some post type edit lists, but not this one, until I found this ticket...
I can confirm that adding the supports => titles does fix the problem, but it's not absolute: I have two CPT, registered with basically identical args, and neither supports titles - but one manifests the javascript error on edit.php and the other does not...

I found it worked before, and after Scribu; unless I'm holding it wrong?