You are here

function slickgrid_taxonomy_field_get_vid in Slickgrid 6

Get the vid from a taxonomy field

Parameters

object $handler:

Return value

mixed returns numeric vid if field is editable (only one vid is selected), returns false if none or multiple vids (so not editable)

2 calls to slickgrid_taxonomy_field_get_vid()
slickgrid_preprocess_views_view_slickgrid in ./slickgrid.module
Preprocessor for views-view-slickgrid.tpl.php Repurpose the views result for slickgrid
slickgrid_views_plugin::is_editable in ./slickgrid_views_plugin.inc

File

./slickgrid.module, line 809

Code

function slickgrid_taxonomy_field_get_vid($handler) {
  $vids = array_filter($handler->options['vids']);

  // We can only use this as an editable field if one VID is selected
  if (count($vids) == 1) {
    return current($vids);
  }
  return FALSE;
}