• From what I can tell, it’s not currently possible to explicitly enable controls for a block type. I’d like to allow Pattern (used to be called Reusable) blocks to show visibility controls, but I don’t want to enable FCM for every block in doing so.

    It seems that you can explicitly disable controls by using the 'blockVisibility.globallyRestrictedBlockType' filter. But there isn’t currently a filter to do the opposite (without enabling FCM and then manually toggling off everything you don’t want, which can be error-prone and tedious).

    I looked at adding my own filter to add support to the block, but there is no way to access the default attributes variable from outside the JS plugin module itself (import { blockVisibilityProps } from './attributes';) (https://github.com/ndiego/block-visibility/blob/12cd9fb4a40f32ce1390d88a4519cf5667d5c424/src/editor/index.js#L68).

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Nick Diego

    (@ndiego)

    Hi @coreyw,

    Thanks for reaching out. There is no direct filter for this, but it might be possible by filtering block supports. The plugin applies a custom block support to all blocks that have visibility conditions enabled.

    I will follow up once I do a bit more investigation.

    Best,
    Nick

    Thread Starter Corey Worrell

    (@coreyw)

    @ndiego, any thoughts on this yet? Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Allow filter for whether visibility controls are shown or not’ is closed to new replies.