Created
February 20, 2019 13:29
-
-
Save httpstersk/f95aba0b969bba6f7c55154bfd095df6 to your computer and use it in GitHub Desktop.
➋➎ Get the post author's display name
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { select } = wp.data; | |
const { getAuthors } = select( 'core' ); | |
const { getEditedPostAttribute } = select( 'core/editor' ); | |
const authorID = getEditedPostAttribute( 'author' ); | |
const { name } = getAuthors().find(a => a.id === authorID); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment