function title_field_replacement_hide_label in Title 7
Hides the label from the given variables.
Parameters
$entity_type: The name of the entity type.
$entity: The entity to work with.
$vaiables: A reference to the variables array related to the template being processed.
$page: (optional) The current render phase: page or entity. Defaults to entity.
4 calls to title_field_replacement_hide_label()
- title_process_comment in ./
title.core.inc - Process variables for comment.tpl.php.
- title_process_node in ./
title.core.inc - Process variables for node.tpl.php.
- title_process_page in ./
title.core.inc - Process variables for page.tpl.php.
- title_process_taxonomy_term in ./
title.core.inc - Process variables for taxonomy-term.tpl.php.
File
- ./
title.module, line 913
Code
function title_field_replacement_hide_label($entity_type, $entity, &$variables, $page = FALSE) {
list(, , $bundle) = entity_extract_ids($entity_type, $entity);
$instance = title_field_replacement_get_label_field($entity_type, $bundle);
$settings_key = $page ? 'page' : 'entity';
if (!empty($instance['settings']['hide_label'][$settings_key])) {
// If no key is passed default to the label one.
if ($page) {
$key = 'title';
}
else {
$info = entity_get_info($entity_type);
$key = $info['field replacement'][$info['entity keys']['label']]['preprocess_key'];
}
// We cannot simply unset the variable value since this may cause templates
// to throw notices.
$variables[$key] = FALSE;
}
}