justintadlock / members

Members WordPress plugin.
GNU General Public License v2.0
404 stars 97 forks source link

Gutenberg: Show/hide blocks #180

Closed justintadlock closed 5 years ago

justintadlock commented 6 years ago

Now that Gutenberg and WP 5.0 are around the corner, it's time to give some serious thought about integration. I'm not sure if this will be directly in Members or an add-on plugin, but I wanted to get the ball rolling on the idea.

Gutenberg is a block-based system. Right now, the primary focus is the editor. However, blocks will be replacing many things in the future.

Each block in Gutenberg can have its own settings. The idea here is for Members to "hook" into each block's settings and add its own permissions settings. That way, users can control this on a per-block basis.

This would be a combination of the following things:

Permissions could be based on:

Each block should be able to show either:

This new system wouldn't completely replace the old stuff. I still think it's smart to have post/page-level access, so the Content Permissions wouldn't be going anywhere. And, shortcodes will always be available for back-compat anyway.

Rather, this system is going to be the future. Block-based permissions are where it's at.

Where to start?

I have minimal experience coding for Gutenberg at this point. And, I'm not even sure that it's possible to hook into other blocks' settings.

So, that's where we begin.

JulienMelissas commented 6 years ago

Hey Justin! This is a good idea to start thinking about this, so thanks for that! I've got a little bit of Gutenberg experience and would love to help with this but time is a bit short currently. I'll make sure to watch this and see if I can add input or help hack on some things if I can find some more time.

phpbits commented 6 years ago

@justintadlock and @JulienMelissas you can check this plugin of mine : https://wordpress.org/plugins/block-options/ which already has the option to manage block visibility. I've also added Display Logic for custom restriction :) I hope you'll love it!

Cheers!

bogdano2 commented 5 years ago

Any updates on adding role based block visibility?

justintadlock commented 5 years ago

It's been a long time coming, but I'm finally releasing this today. Woo-hoo!

https://themehybrid.com/plugins/members-block-permissions

I'll have an official announcement up on the Theme Hybrid blog today.