Possible Duplicate: How to show custom meta box on “Quick Edit” screen?
I’m trying to edit the quick edit screen on my custom post type “visitor” so that I can add some options for my end-users. My custom post type doesn’t require/need a post date, password to view, publish status, or large taxonomy boxes for custom categories of visitors on it.
I’ve already added a custom meta box for the actual edit page, but would like to enable quick-edit support of those post meta fields while disabling the current quick-edit options.
I also found a post (linked in my possible duplicate) over on wordpress.org’s forums, but not sure exactly what it does.
I use this to add form fields to the quick edit. It’s not entirely easy to do this in WP (yet) and it can be very difficult to find info on how to do it. You have to really dig through the source to find it too.
Add Form fields to Quick Edit
<?php
add_action('quick_edit_custom_box', 'quickedit_posts_custom_box', 10, 2);
add_action('admin_head-edit.php', 'quick_add_script');
function quickedit_posts_custom_box( $col, $type ) {
if( $col != 'COLUMN_NAME' || $type != 'post' ) {
return;
} ?>
<fieldset class="inline-edit-col-right"><div class="inline-edit-col">
<div class="inline-edit-group">
<label class="alignleft">
<input type="checkbox" name="yourformfield" id="yourformfield_check">
<span class="checkbox-title">This Post Has Cake</span>
</label>
</div>
</fieldset>
<?php
}
function quick_add_script() { ?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('a.editinline').live('click', function() {
var id = inlineEditPost.getId(this);
var val = parseInt(jQuery('#inline_' + id + '_yourformfield').text());
jQuery('#yourformfield_check').attr('checked', !!val);
});
});
</script>
<?php
}