Filter blocks based on roles/permissions required to use blocks #20177
Labels
[Feature] Block API
API that allows to express the block paradigm.
[Feature] Inserter
The main way to insert blocks using the + button in the editing interface
[Type] Feature
New feature to highlight in changelogs.
Is your feature request related to a problem? Please describe.
The issue that inspired this feature request is blocks that insert SVG into the post content can only be authored by Admins or Editors who have the
unfiltered_html
capability, otherwisewp_kses
will strip out the content without notification, warnings, or errors.This makes it impractical to create a block that requires this because Authors or other roles might try to use it and get frustrated since it will not work, and difficult to troubleshoot.
Describe the solution you'd like
One solution that would work is a block declares what roles are required to use the block, by default it could be any, so works with all previous blocks. The inserter could then limit showing blocks to users based on what roles they have.
The text was updated successfully, but these errors were encountered: