Skip to content
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

Best way to migrate Meta #13115

Closed
mattyrob opened this issue Dec 27, 2018 · 4 comments
Closed

Best way to migrate Meta #13115

mattyrob opened this issue Dec 27, 2018 · 4 comments
Labels
[Feature] Plugins API Extending the Gutenberg project with plugins via the Plugins API Needs Technical Feedback Needs testing from a developer perspective. [Type] Help Request Help with setup, implementation, or "How do I?" questions.

Comments

@mattyrob
Copy link

I have a plugin that creates a post meta field. This field, if entered late can be missed during the post transition hooks where other actions in my code fire. Until now I've been able to access the $_POST global but that isn't working in the new editor.

I've therefore been looking at creating a 'Gutenberg' way of rendering my post meta input area that was previously in a meta box. A block seems an irrational way of doing it as blocks seems more purposed for content creation and this is not content.

So, Im trying a sidebar and it's working okay but for one issue. Sidebars can be 'pinned' and 'pinnable'. In order for my new sidebar to be visible it must be pinned, which means it must also be pinnable based on my analysis of the current code.

The downside here is that if I click the star and unpin my sidebar, once I leave it, there is no way to get it back.

Has this been noted until now or consider? Or am I missing an easy way to pin it without make it unpinnable?

@swissspidy swissspidy added [Feature] Plugins API Extending the Gutenberg project with plugins via the Plugins API [Type] Help Request Help with setup, implementation, or "How do I?" questions. Needs Technical Feedback Needs testing from a developer perspective. labels Dec 27, 2018
@youknowriad
Copy link
Contributor

Has this been noted until now or consider? Or am I missing an easy way to pin it without make it unpinnable?

The idea is that plugins can be pinned by default, but we allow the user to control the UI. Imagine a user installing 10 plugins making them selves unpinnable. The editor would become unusable at this point, that's why it's always possible to unpin a plugin.

@mattyrob
Copy link
Author

@youknowriad

Thanks for the answer - as a follow up then, once the user has uncluttered their screen and hidden these plugins - how do they then restore them? (That was the area of greater concern for me).

@youknowriad
Copy link
Contributor

@mattyrob you can register a menu item in the more menu item. (That's what Yoast do for instance). See https://github.com/WordPress/gutenberg/tree/master/packages/edit-post#pluginsidebarmoremenuitem

I hope this helps.

@mattyrob
Copy link
Author

@youknowriad

Thanks for the link and tip. I’ll have a look at that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Plugins API Extending the Gutenberg project with plugins via the Plugins API Needs Technical Feedback Needs testing from a developer perspective. [Type] Help Request Help with setup, implementation, or "How do I?" questions.
Projects
None yet
Development

No branches or pull requests

3 participants