function hook_taxonomy_display_save_fields_alter in Taxonomy display 7
Alter a vocabulary's taxonomy_display settings before save.
Parameters
array $save_data: Associative array containing the values to save in the database, note that all associative keys listed in taxonomy_display_save_taxonomy_display() may not be available if plugins are missing upon save.
Return value
void
See also
taxonomy_display_save_taxonomy_display()
1 invocation of hook_taxonomy_display_save_fields_alter()
- taxonomy_display_save_taxonomy_display in ./
taxonomy_display.module - Helper function; save a taxonomy display record in the database.
File
- ./
taxonomy_display.api.php, line 101 - Hooks provided by the taxonomy_display module.
Code
function hook_taxonomy_display_save_fields_alter(&$save_data) {
// If this is a particular vocabulary
if ($save_data['machine_name'] == 'my_vocabulary_name') {
// If a particular term display plugin was selected.
if ($save_data['term_display_plugin'] == 'HookAssociatedDisplayHandlerImplementingClassName') {
// Set an option for the display plugin, note that key/values will be
// unique to each plugin so the plugin's handler class should be
// referenced to see what values are valid to set.
// Note that after hook_taxonomy_display_save_fields_alter()
// display_options are serialized before storage.
$save_data['term_display_options']['show_feed'] = TRUE;
}
else {
$save_data['term_display_plugin'] = 'TaxonomyDisplayTermDisplayHandlerHidden';
// Set options to customize the display, in this case we don't set any.
$save_data['term_display_options'] = NULL;
}
}
}