Skip to content

Add id and user type to store formatted author data #1110

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

Merged
merged 5 commits into from
Apr 15, 2025

Conversation

miguelpeixe
Copy link
Member

@miguelpeixe miguelpeixe commented Apr 10, 2025

Description

Add the author ID and user type to the store's formatted data. This is useful for 3rd parties that need to read from the edited post authors' data.

Usage example: Automattic/newspack-plugin#3906

Deploy Notes

Just a js build.

Steps to Test

There should be no impact on the plugin behavior. Make sure the "Authors" panel continues to work as expected.

src/utils.js Outdated
@@ -72,8 +72,9 @@ export const addItemByValue = (
*
* @return {Object} The object containing data relevant to the Coauthors component.
*/
export const formatAuthorData = ( { displayName, userNicename, email } ) => {
export const formatAuthorData = ( { id, displayName, userNicename, email } ) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to also update the docblock

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated in eaf5107

@miguelpeixe miguelpeixe changed the title Add id to store formatted author data Add id and user type to store formatted author data Apr 10, 2025
@leogermani
Copy link
Contributor

@GaryJones we need this tiny change for something that we are releasing soon on Newspack. Any concerns if I spin up a new version with it?

@GaryJones GaryJones merged commit 52a9762 into develop Apr 15, 2025
8 checks passed
@GaryJones GaryJones deleted the feat/add-id-to-formatted-data branch April 15, 2025 05:33
@GaryJones GaryJones added this to the 3.6.5 milestone Apr 15, 2025
@GaryJones GaryJones mentioned this pull request Apr 15, 2025
@miguelpeixe
Copy link
Member Author

Thanks, @GaryJones!

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.

3 participants