You are here

function bynder_remove_hidden_facets in Bynder 7

File

includes/bynder.browser.inc, line 634
Manages the Bynder media browser functionality

Code

function bynder_remove_hidden_facets($available_facets, $selected_facets) {
  foreach ($selected_facets as $selected_facet_key => $selected_facet) {
    $value = $selected_facet[0];
    $isset = isset($available_facets[$selected_facet_key][$value]);
    if (!$isset) {
      unset($selected_facets[$selected_facet_key]);
    }
  }
  return $selected_facets;
}