function hook_block_attribute_info in Block Attributes 7
Inform the block_attributes module about custom attributes.
Return value
array An array of attributes to be controlled by Block Attributes, keyed by attribute name. Each attribute record should be an array with the following key/value pairs:
- label: The human-readable name of the attribute.
- description: The attribute description.
- form: A Form API array. Some default values for this array are provided in block_attributes_get_block_attribute_info().
- scope: An array of scope options, BLOCK_ATTRIBUTES_BLOCK, BLOCK_ATTRIBUTES_TITLE, BLOCK_ATTRIBUTES_CONTENT or all three. If no scope is provided, all three will be assumed.
See also
block_attributes_block_attribute_info()
block_attributes_get_block_attribute_info()
2 functions implement hook_block_attribute_info()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- block_attributes_block_attribute_info in ./
block_attributes.module - Implements hook_block_attribute_info().
- block_attributes_get_block_attribute_info in ./
block_attributes.module - Fetch an array of block attributes.
1 invocation of hook_block_attribute_info()
- block_attributes_get_block_attribute_info in ./
block_attributes.module - Fetch an array of block attributes.
File
- ./
block_attributes.api.php, line 26 - Documentation for Block Attributes API.
Code
function hook_block_attribute_info() {
// Add a Tabindex attribute.
$info['tabindex'] = array(
'label' => t('Tabindex'),
'description' => t('Specifies the tab order for the block.'),
'form' => array(
'#maxlength' => 3,
'#size' => 2,
),
'scope' => array(
BLOCK_ATTRIBUTES_BLOCK,
),
);
return $info;
}