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

Campaigns Editor panel should be labeled as "Campaign" and not "Document" #5295

Closed
1 task
kjohnson opened this issue Sep 23, 2020 · 3 comments
Closed
1 task
Assignees
Labels
type: bug Existing functionality is broken

Comments

@kjohnson
Copy link
Member

kjohnson commented Sep 23, 2020

Expected Behavior

The main sidebar panel in the Block Editor should use the Custom Post Type singular_name label, with "Document" as a fallback. The singular_name is set, but not showing in the Block Editor.

const documentLabel = useSelect( ( select ) => {
	const currentPostType = select( 'core/editor' ).getCurrentPostType();
	const postType = select( 'core' ).getPostType( currentPostType );

	return (
		postType?.labels?.singular_name ??
		__( 'Document' )
	);
} );

https://github.com/WordPress/gutenberg/blob/8bfa69b424ac0cfbaa8290d7967bfacd5e653dd8/packages/edit-post/src/components/sidebar/settings-header/index.js#L14

Visuals

Post Page Custom Post Type
image image image

Additional Context

Acceptance Criteria

  • Campaigns CPT sidebar label is "Campaign"
@kjohnson kjohnson added the type: bug Existing functionality is broken label Sep 23, 2020
@kjohnson
Copy link
Member Author

This seems to be a bug in Gutenberg.

@kjohnson kjohnson self-assigned this Sep 24, 2020
@kjohnson
Copy link
Member Author

I pulled down the Gutenberg repo. The build works as expected, so maybe this is an unreleased feature.

@kjohnson
Copy link
Member Author

kjohnson commented Sep 24, 2020

Looks like the edit-post module isn't the latest version. WP 5.5-beta-4 shipped with edit-post v3.21.3, so I'm guessing that the document label feature may have just missed that cut off.

See WordPress/WordPress@8e433f2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Existing functionality is broken
Projects
None yet
Development

No branches or pull requests

1 participant