public function BlockStyleBase::exclude in Block Style Plugins 8
Exclude styles from appearing on a block.
Determine if configuration should be excluded from certain blocks when a block plugin id or block content type is passed from a plugin.
Return value
bool Return True if the current block should not get the styles.
Overrides BlockStyleInterface::exclude
1 call to BlockStyleBase::exclude()
- BlockStyleBase::prepareForm in src/
Plugin/ BlockStyleBase.php - Returns the configuration form elements specific to a block configuration.
File
- src/
Plugin/ BlockStyleBase.php, line 320
Class
- BlockStyleBase
- Base class for Block style plugins.
Namespace
Drupal\block_style_plugins\PluginCode
public function exclude() {
$list = [];
if (isset($this->pluginDefinition['exclude'])) {
$list = $this->pluginDefinition['exclude'];
}
$block_plugin_id = $this->blockPlugin
->getPluginId();
if (!empty($list) && (in_array($block_plugin_id, $list) || $this
->baseIdMatch($block_plugin_id, $list) || in_array($this->blockContentBundle, $list))) {
return TRUE;
}
return FALSE;
}