Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use post type labels in PostFeaturedImage component #10681

Merged
merged 1 commit into from Oct 17, 2018

Conversation

ocean90
Copy link
Member

@ocean90 ocean90 commented Oct 17, 2018

Description

A post type can register custom labels for featured image support. The current PostFeaturedImage component didn't handle this consistently.

How has this been tested?

A new CPT with custom labels for the featured image :

add_action( 'init', function() {
	register_post_type( 'my-foo', [
		'public'       => true,
		'show_in_rest' => true,
		'supports'     => [ 'title', 'editor', 'thumbnail' ],
		'labels'       => [
			'name'                  => _x( 'Team', 'post type general name', 'my-foo' ),
			'singular_name'         => _x( 'Person', 'post type singular name', 'my-foo' ),
			'featured_image'        => __( 'Photo', 'my-foo' ),
			'set_featured_image'    => __( 'Set photo', 'my-foo' ),
			'remove_featured_image' => __( 'Remove photo', 'my-foo' ),
			'use_featured_image'    => __( 'Use as photo', 'my-foo' ),
		],
	] );
} );

Instead of "Set featured image" the component now prints "Set photo". The title of the media modal now also reflects the featured_image label.

@ocean90 ocean90 added this to the 4.1 - UI freeze milestone Oct 17, 2018
@ocean90 ocean90 added [Type] Bug An existing feature does not function as intended [Feature] Media Anything that impacts the experience of managing media [Package] Editor /packages/editor labels Oct 17, 2018
@danielbachhuber
Copy link
Member

Restarted the job. Looks like we have an intermittent e2e failure again:

image

@danielbachhuber danielbachhuber merged commit 533fa29 into master Oct 17, 2018
@danielbachhuber danielbachhuber deleted the fix/featured-image-labels branch October 17, 2018 22:21
danielbachhuber added a commit that referenced this pull request Oct 17, 2018
@mtias
Copy link
Member

mtias commented Oct 18, 2018

Thanks for the improvement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Media Anything that impacts the experience of managing media [Package] Editor /packages/editor [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants