[wp-trac] [WordPress Trac] #18496: Quick edit loses custom colums and custom order - looks bad
WordPress Trac
wp-trac at lists.automattic.com
Sun Nov 6 23:28:49 UTC 2011
#18496: Quick edit loses custom colums and custom order - looks bad
-------------------------------+-------------------------
Reporter: anmari | Owner:
Type: defect (bug) | Status: closed
Priority: normal | Milestone:
Component: Quick/Bulk Edit | Version: 3.2.1
Severity: minor | Resolution: worksforme
Keywords: reporter-feedback |
-------------------------------+-------------------------
Comment (by anmari):
Hi guys,
sorry - will try get back to this and post simple plugin code to recreate.
at the moment hard to separate it out from huge plugin with data creation
- will try condense to demonstrate - maybe I'll see why then!.
Just wanted to note that I had a quick look still see it in wp 3.2.1 and
am wondering whether it is because
1) I've re-ordered the columns to be more meaningful - my gut tells me
maybe this is why
2) the custom columns are sortable (using a filter on request and
checking for orderby)
3) there are added edit actions
4) post type is hierarchical
I hope to have more time end of week to address this. But just in case
anyone has similar situation, thought I'd at least post this for now:
the reorder code re pt 1:
{{{
add_filter('manage_posts_columns',
'amr_ical_post_columns');
function amr_ical_post_columns ($defaults) {
global $amr_event_post_type;
if (!does_ical_apply() ) return ($defaults);
if (isset ($_GET['post_type'])) $posttype=
$_GET['post_type'];
else $posttype= 'post';
$defaults['title'] = __('Title'); //use default domain
unset ($defaults['tags']);
unset ($defaults['author']);
unset ($defaults['date']);
unset ($defaults['comments']);
unset ($defaults['categories']); /* unset so when re-add
they will be on the side */
unset ($defaults['author']);
$defaults['_DTSTART'] = __('Start Date', 'amr-events');
// $defaults['_DTEND'] = __('End Date', 'amr-events');
$defaults['_DURATION'] = __('Duration', 'amr-events');
$defaults['_RRULE'] = __('Repeats', 'amr-events');
$defaults['_last'] = __('Last', 'amr-events'); // used to
manage events only
$defaults['_LOCATION'] = __('Location', 'amr-events');
$defaults['categories'] = __('Categories', 'amr-events');
$defaults['author'] = __('Author', 'amr-events');
// $defaults['date'] = __('Date Created');
// $defaults['comments'] = __('Comments');
$taxonomies = get_taxonomies (
array( 'public' => true,
'_builtin' => false,
'object_type' =>
array($posttype)),
'objects');
foreach ($taxonomies as $key => $taxonomy) {
if (in_array($posttype,$taxonomy->object_type)) /*
need to double check as wp is returning ical taxo when post type = post */
$defaults [$key] = $taxonomy->label;
}
// }
return $defaults;
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18496#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list