Modules / Visibility & conditions

Condition: user capability

Show or hide an element by a WordPress capability, such as edit_posts or manage_woocommerce, instead of by role.

#32 of 39 modules by votes

  • On by default
  • Needs Bricks 2.4 or newer
  • Tested with Bricks 2.4.3

Tile 32 of 39, ranked by votes · Recording in progress

Where to find it in the builder

Element conditions: User can, in the Kiln group.

How to use it

  1. Select the element and open its Conditions.
  2. Add the condition User can from the Kiln group.
  3. Choose has capability or lacks capability.
  4. Type the capability name, for example edit_posts.

A capability from a membership plugin or another plugin works the same way. Type its name as that plugin documents it.

Limits

  • Use primitive capabilities, such as edit_posts or manage_options. A capability that needs an object ID, such as edit_post, is not supported.
  • A name can hold letters, digits, underscores and hyphens. Anything else, or an empty field, makes the condition false.
  • A visitor who is logged out has no capabilities. lacks capability is true for them.
  • The field takes a plain name. It does not render dynamic data.

Settings

None. Turn the module on in Bricks > Kiln (it is on by default).

Requirements

Bricks 2.4 or newer.