Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#31698 closed defect (bug) (wontfix)

Fields added via `attachment_fields_to_edit` filter not included in "Image Details" UI

Reported by: danielbachhuber's profile danielbachhuber Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Media Keywords: needs-patch
Focuses: Cc:

Description

I can add a field to the Attachment Details UI via the attachment_fields_to_edit filter:

add_filter( 'attachment_fields_to_edit', function( $fields, $post ){
	$metadata = wp_get_attachment_metadata( $post->ID );
	if ( ! empty( $metadata['image_meta'] ) ) {
		$fields['fusion_credit'] = array(
			'label'              => esc_html__( 'Credit', 'fusion' ),
			'input'              => 'text',
			'value'              => $metadata['image_meta']['credit'],
			);
	}
	return $fields;
}, 10, 2 );

I'd expect this field would be appear in "Image Details" too, but it doesn't (ignore the credit in the caption field):

https://dl.dropboxusercontent.com/s/zhizhxmpb7a27uf/2015-03-19%20at%201.33%20PM%20%281%29.png

Change History (3)

#1 @DrewAPicture
10 years ago

  • Keywords close added

From @helen's closing comment on #22926:

When you edit an image that's inserted into the post, you're actually now editing post content, not the attachment details in the library anymore. It's kind of a tricky concept, so I definitely see the confusion. Happy to discuss is some more, but closing for now.

#2 follow-up: @danielbachhuber
10 years ago

  • Keywords close removed

Then we should fix the UX inconsistency. The user doesn't know any different.

#3 in reply to: ↑ 2 @helen
10 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Replying to danielbachhuber:

Then we should fix the UX inconsistency. The user doesn't know any different.

Always open to more ideas on how to make the differences clearer, as it was significant work to even get to this point in 3.9 and we definitely know it could be even better; however, this particular ticket is a wontfix.

Note: See TracTickets for help on using tickets.