Co-Authors-Plus icon indicating copy to clipboard operation
Co-Authors-Plus copied to clipboard

Filter author label during selection

Open Ritesh-patel opened this issue 1 year ago • 0 comments

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

Ritesh-patel avatar Aug 14 '23 17:08 Ritesh-patel