Created
January 16, 2019 13:59
-
-
Save httpstersk/de03c9d0901f750496be0420a9381596 to your computer and use it in GitHub Desktop.
➓ Set & get a custom post meta
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 { dispatch, select } = wp.data; | |
const { editPost } = dispatch( 'core/editor' ); | |
const { getEditedPostAttribute } = select( 'core/editor' ); | |
editPost({ meta: { is_special: true } }) | |
const isSpecial = getEditedPostAttribute( 'meta' )[ 'is_special' ]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment