

The 'Block logic' field at work in the block editor.
Block Logic adds a “Block Logic” field to the “Advanced” section of the block editor (i.e Gutenberg), that lets you show or hide any block based on conditions. You can use WordPress’ Conditional Tags or any general PHP code.
Does not work with the Classic Block, Widget Block or Widget Area Block [‘core/freeform’, ‘core/legacy-widget’, ‘core/widget-area’], as the those blocks do not support block attributes. Does also not work with the HTML Block [‘core/html’] inside the Widget Screen, as this one also does not support block attributes there.
Just activate the plugin. The “Block Logic” textbox will then appear in the “Advanced” section of the Gutenberg editor.
Since version 2.0.0 the code does not get eval’d directly, but there is a whitelist of allowed functions that can be extended via a filter.
When upgrading to version 2.x you will need to update your logic. No return is allowed anymore and no semicolons in code as only expressions are evaluated. See FAQ Section Writing Logic Code.