You are here

function _hashtags_get_tt_key in Hashtags 8

Get taxonomy term key from the array of term values.

Parameters

$tags term values that are returned with .getValue(): Format: [ 0 => [ target_id: tid1 ], 1 => [ target_id: tid2 ] ]

$property_value - term id that should be found:

$property_name - 'target_id' by default:

Return value

  • the key of the term id
1 call to _hashtags_get_tt_key()
_hashtags_field_remove_term in ./hashtags.module
Helper function that remove a term from the taxonomy terms hashtags field

File

./hashtags.module, line 280

Code

function _hashtags_get_tt_key($tags, $property_value, $property_name = 'target_id') {
  return array_search($property_value, array_filter(array_combine(array_keys($tags), array_column($tags, $property_name))));
}