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

Filter author label during selection #978

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Ritesh-patel
Copy link
Contributor

Description

This PR adds a filter coAuthors.author.label.formatted which allows developers to change author label in the Author's panel in editor. With this new filter, more author data can be shown while selecting the author.

Filter usage:

import { addFilter } from '@wordpress/hooks';

addFilter(
	'coAuthors.author.label.formatted',
	'coauthors/format-author-label',
	(label, author) => {
		return `${ author.displayName } | ${ author.email } | ${ author.userNicename }`;
	},
);

Deploy Notes

Are there any new dependencies added that should be taken into account when deploying to WordPress.org?

Steps to Test

Outline the steps to test and verify the PR here.

  1. Check out PR.
  2. Use the example code as above

@GaryJones GaryJones added this to the 3.6 milestone Aug 15, 2023
@GaryJones GaryJones changed the base branch from main to develop August 25, 2023 15:20
@alecgeatches alecgeatches modified the milestones: 3.6, 3.7 Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants