ndiego / block-visibility

Conditional visibility controls for all WordPress blocks.
https://www.blockvisibilitywp.com
GNU General Public License v2.0
129 stars 10 forks source link

Add Capability-Based Block Display Options #118

Open qarayahya opened 1 week ago

qarayahya commented 1 week ago

What problem does this address?

Currently, Block Visibility allows displaying blocks based on various criteria, such as user roles, page types, etc. However, it lacks the ability to control block visibility based on user capabilities. This limitation can be problematic when you want to display certain blocks only to users with specific permissions, regardless of their role.

What is your proposed solution?

Introduce a new capability-based option for displaying blocks. This option would allow users to specify a capability (e.g., "read_premium_posts") and only display the block if the current user has that capability.

Example: