Issue #2248951 by eojthebrave: Missing documentation for block plugin annotations.
parent
04d9f33941
commit
33223ad729
|
@ -32,4 +32,20 @@ class Block extends Plugin {
|
||||||
*/
|
*/
|
||||||
public $admin_label = '';
|
public $admin_label = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The category in the admin UI where the block will be listed.
|
||||||
|
*
|
||||||
|
* @var \Drupal\Core\Annotation\Translation
|
||||||
|
*
|
||||||
|
* @ingroup plugin_translatable
|
||||||
|
*/
|
||||||
|
public $category = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class used to retrieve derivative definitions of the block.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public $derivative = '';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ class BlockManager extends DefaultPluginManager {
|
||||||
parent::processDefinition($definition, $plugin_id);
|
parent::processDefinition($definition, $plugin_id);
|
||||||
|
|
||||||
// Ensure that every block has a category.
|
// Ensure that every block has a category.
|
||||||
if (!isset($definition['category'])) {
|
if (empty($definition['category'])) {
|
||||||
$definition['category'] = $this->getModuleName($definition['provider']);
|
$definition['category'] = $this->getModuleName($definition['provider']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue