function hook_blockreference_potential_references2_alter in Block reference 7
Alter the potential references.
Parameters
$blocks: List of referenceable blocks. Always keyed by bid. Might contain full block objects or only block titles, depending on `$context['return_full_blocks']`.
$context: Assoc array containing:
- field: Array: Array containing field data from field_info_field().
- current_bids: Array: current field values.
- return_full_blocks: Bool: Whether to return full blocks.
- string: String: Filter string to match blocks.
- exact_string: Bool: Strictly match string like for validation.
1 invocation of hook_blockreference_potential_references2_alter()
- _blockreference_potential_references in ./
blockreference.module - Fetch an array of all candidate referenced blocks.
File
- ./
blockreference.api.php, line 43 - Documents Block reference's hooks for api reference.
Code
function hook_blockreference_potential_references2_alter(&$blocks, $context) {
$secret_bid = db_query('SELECT bid FROM {block} WHERE module = ? AND delta = ?', array(
'foo',
'bar',
))
->fetchField();
unset($blocks[$secret_bid]);
}