More details: when I use the tutorial instructions to add a new field to the Quick Edit panel of posts, it works. But when I try to add it to my custom post type, I get this notice:
Notice: Trying to get property ‘name’ of non-object in /public_html/wp-content/plugins/admin-columns-pro/admin-columns/classes/Settings/Column/Term.php on line 78
So I gather that the admin list view of my CPT doesn’t recognize the simple column I added like this:
// my custom post type is called 'activity_log_item'
add_filter( 'manage_activity_log_item_posts_columns', 'new_comment_option_in_quick_edit_add_columns' );
function new_comment_option_in_quick_edit_add_columns( $column_array ) {
$column_array[ 'new_comment' ] = 'New Comment';
return $column_array;
}
So the question is: how do I add a field to the Quick Edit View when I’m using Admin Columns Pro?
Also, I tried to add the new comments field as below, but then when I choose Edit from under the Bulk Actions drop down and click Apply, nothing happens. The normal bulk edit form view does not show up. And when I click Quick Edit on an individual custom post type item, my new field is not showing, either.
add_action( 'bulk_edit_custom_box', 'misha_quick_edit_fields', 10, 2 );
add_action( 'quick_edit_custom_box', 'misha_quick_edit_fields', 10, 2 );
function misha_quick_edit_fields( $column_name, $post_type ) {
switch( $column_name ) {
case 'new_comment': {
?>
<fieldset class="inline-edit-col-left">
<div class="inline-edit-col">
<label>
<span class="title">Add New Comment:</span>
<textarea name="new_comment"></textarea>
</label>
</div>
<?php
break;
}
}
}