diff --git a/metatags_quick.module b/metatags_quick.module index 1d244f5..38008b7 100644 --- a/metatags_quick.module +++ b/metatags_quick.module @@ -298,6 +298,7 @@ function _metatags_quick_settings_default() { // Create basic meta fields. function _metatags_quick_init_basic_fields() { $types = node_type_get_types(); + $vocabularies = taxonomy_get_vocabularies(); if (empty($types)) { $msg = t('No content types defined. !l first', array('!l' => l(t('define them'), 'admin/structure/types'))); @@ -326,7 +327,22 @@ function _metatags_quick_init_basic_fields() { ), ); field_create_instance($instance); - } + } + // Add field instance to all found vocabularies + foreach ($vocabularies as $vocab) { + $instance = array( + 'field_name' => $field['field_name'], + 'entity_type' => 'taxonomy_term', + 'bundle' => $vocab->machine_name, + 'label' => t('Meta Keywords'), + 'formatter' => 'metatags_quick_default', + 'widget' => array( + 'type' => 'metatags_quick_textfield', + 'weight' => 0, + ), + ); + field_create_instance($instance); + } $field = array( 'field_name' => 'meta_description', 'type' => 'metatags_quick', @@ -349,6 +365,21 @@ function _metatags_quick_init_basic_fields() { ), ); field_create_instance($instance); + } + // Add field instance to all found vocabularies + foreach ($vocabularies as $vocab) { + $instance = array( + 'field_name' => $field['field_name'], + 'entity_type' => 'taxonomy_term', + 'bundle' => $vocab->machine_name, + 'label' => t('Meta Description'), + 'formatter' => 'metatags_quick_default', + 'widget' => array( + 'type' => 'metatags_quick_textfield', + 'weight' => 0, + ), + ); + field_create_instance($instance); } } @@ -359,4 +390,4 @@ function _metatags_strlen($str) { else { return strlen($str); } -} \ No newline at end of file +}