-
Notifications
You must be signed in to change notification settings - Fork 0
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
Enable Reusable Blocks in the admin menu #19
Comments
In s.b/wp52 I was able to get the Blocks menu item to appear by hacking core. I'm not sure why oik-types logic did not take effect. |
I've finally tracked it down. By hacking core to set _builtin = false and then using oik-types to update the post type definition it was possible to save the value as _builtin = 0 This then overrode the initially registered value. It would seem that the simple solution would be to add the _builtin checkbox to the oik-types admin page. |
I’ve tested this solution in bobbingwide.com/problem-solving. The Blocks admin menu item does appear. This issue can be closed. There are some follow on issues associated with editing blocks:
|
In terms of Problem Solving this was a good example for Step 7: Persist. |
Requirement
To be able to Create and Edit Reusable blocks ( post_type=wp_block ) directly from the WordPress Dashboard.
Proposed solution
Extend oik-types to override
_builtin = true
and/or adjust the capabilities of a post type.Alternative solution
Just use Bill Erickson's plugin. https://github.com/billerickson/Reusable-Blocks-UI
Background
Some time ago, when looking at Reusable blocks for the first time, I tried to use oik-types to enable "Blocks" to appear in the admin menu.
I finally achieved it ( in
s.b/wordpress
) by updating the administrator role's capabilities.But I can't remember exactly how I did it.
It could have been a simple edit of the serialised data to add the missing capabilities to
wp_user_roles
inwp_options
.In unhacked environments I have these 5 capabilities for blocks:
In s.b/wordpress I have 6 more
or I could have done it programmatically, or with a plugin.
I may even have hacked 'core', which caused it to update the options table for me.
Anyway, in order to be able to clone the content in Reusabe blocks I believe I have this need to reproduce what I did on s.b/wordpress on other sites.
Notes
Using oik-types does enable the New > Block link in the top admin menu
https://s.b/wordpress/wp-admin/post-new.php?post_type=wp_block
You have to select "Show in admin bar", then refresh the page.
but the Blocks and All Blocks link in the side menu is not present
https://s.b/wordpress/wp-admin/edit.php?post_type=wp_block
I've searched code changes for
_builtin
, traced filter results forregister_post_type_args
and grepped my daily notes files to no avail.See also bobbingwide/oik-clone#24 (comment)
The text was updated successfully, but these errors were encountered: