You are here

function content_taxonomy_field_get_parent in Content Taxonomy 6

Same name and namespace in other branches
  1. 6.2 content_taxonomy.module \content_taxonomy_field_get_parent()

Returns the parent term ID for one field can be 0 is no parent is selected or if the php code returns 0

use this function instead of directly accessing $field['parent'] because of possible php code

Parameters

$field The Content Taxonomy Field:

6 calls to content_taxonomy_field_get_parent()
content_taxonomy_allowed_values in ./content_taxonomy.module
Called by content_allowed_values to create the $options array for the content_taxonomy_options
content_taxonomy_allowed_values_groups in ./content_taxonomy.module
Creating Opt Groups for content_taxonomy_options
content_taxonomy_autocomplete_form2data in ./content_taxonomy_autocomplete.module
Helper function to transpose the values returned by submitting the content_taxonomy_autcomplete to the format to be stored in the field
content_taxonomy_autocomplete_load in ./content_taxonomy_autocomplete.module
Retrieve a pipe delimited string of autocomplete suggestions
content_taxonomy_autocomplete_validate in ./content_taxonomy_autocomplete.module
Validation function for the content_taxonomy_autocomplete element

... See full list

File

./content_taxonomy.module, line 322
Defines a field type for referencing a taxonomy term.

Code

function content_taxonomy_field_get_parent($field) {
  if (!empty($field['parent_php_code'])) {
    return eval($field['parent_php_code']);
  }
  return $field['parent'];
}