Skip to content

Instantly share code, notes, and snippets.

@vanaf1979
Last active September 22, 2019 14:02
Show Gist options
  • Save vanaf1979/5dc76400551f53c91e52e827d838e06f to your computer and use it in GitHub Desktop.
Save vanaf1979/5dc76400551f53c91e52e827d838e06f to your computer and use it in GitHub Desktop.
Gist for my tutorial: Building a Gutenberg sidebar plugin Part 4: Adding form components. https://vanaf1979.nl/building-a-gutenberg-sidebar-plugin-part-4-adding-form-components/
export default compose([
withDispatch(( dispatch , props ) => {
return {
setMetaFieldValue: function( value ) {
dispatch( 'core/editor' ).editPost( { meta: { metatags_browser_title: value } } );
}
}
}),
withSelect(( select , props ) => {
return {
metaFieldValue: select( 'core/editor' ).getEditedPostAttribute( 'meta' )[ 'metatags_browser_title' ],
};
}),
])( BrowserTitleField );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment