WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 22 months ago

#18496 reopened feature request

Quick edit loses custom colums and custom order - looks bad

Reported by: anmari Owned by:
Milestone: Awaiting Review Priority: normal
Severity: minor Version: 3.2.1
Component: Quick/Bulk Edit Keywords: reporter-feedback
Focuses: Cc:

Description

Using manage_posts_custom_column, 'manage_posts_columns', 'manage_edit-'.$post_type.'_columns' etc

to add custom columns to the manage edit lists and to change the order of the fields.

If Quick edit is used on a post, the custom columns disappear (visually - a refresh displays them again) and the custom column order is reset just for that post.

This results in a rather buggy looking display. (See attached screenshots). All is okay on a refresh of the page.

I think this is related to http://core.trac.wordpress.org/ticket/17935. (explained differently, but possibly similar cause?)

Attachments (2)

before.png (13.5 KB) - added by anmari 3 years ago.
'Before' quick edit
after-incorrectorder.png (12.8 KB) - added by anmari 3 years ago.
After quick edit, custom cols 'lost' and order of columns reset for that post

Download all attachments as: .zip

Change History (11)

anmari3 years ago

'Before' quick edit

anmari3 years ago

After quick edit, custom cols 'lost' and order of columns reset for that post

comment:1 anmari3 years ago

See also http://wordpress.org/support/topic/custom-post-type-quick-edit-list-fields-disappear.

And correction: quick edit isnot resetting, but appears to be pulling in columns that should not be there at all? Looks like maybe from the comments list?

Last edited 3 years ago by anmari (previous) (diff)

comment:2 SergeyBiryukov3 years ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 3.3

comment:3 ocean902 years ago

  • Keywords reporter-feedback added

Can you give some example code? Does it happen in 3.2 too?

comment:4 nacin2 years ago

  • Keywords needs-patch removed
  • Milestone 3.3 deleted
  • Resolution set to worksforme
  • Status changed from new to closed

I can't reproduce this. It's not a bug in core best I can tell — it's something peculiar the few of you are doing. Can we please have some code that can cause this and re-open?

comment:5 jakemgold2 years ago

Also can't replicate this... tried adding a custom column at the beginning, end, and middle, with no luck.

Could swear I've seen this once before, some time ago, but can't replicate now.

comment:6 anmari2 years ago

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;

comment:7 anmari2 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened
  • Type changed from defect (bug) to feature request

Just to confirm that yes it is the unset and redefinition to change the order of the columns that is causing the problem. Actually it seems just the unset causes it even without redefining

Bit slow today, but I of course realised that it is so quick to test that and so did.

I am allowing people to use standard posts as events if they want.

Also allowing support of comments etc but did not want to have too much displayed.

so wanted to hide the less necessary columns and change order of others .

There is another way that one could initially hide a column (and user could add back if they wanted using screen options) - basically set the user option. Cumbersome but could work.

But I do not know another way to change the order of the columns. I think this is a valuable thing to be able to do for a user interface point of view. For custom posts, different columns will be more meaningful and so should be more accessible.

So it is this a feature request then - ability to change order of columns in edit screens? I've marked it as such for now.

comment:8 SergeyBiryukov2 years ago

  • Milestone set to Awaiting Review
Note: See TracTickets for help on using tickets.