You are here

function _media_browser_plus_ensure_instance in Media Browser Plus 7

Same name and namespace in other branches
  1. 7.2 media_browser_plus.install \_media_browser_plus_ensure_instance()

@todo Document what this function does.

Parameters

$instance:

2 calls to _media_browser_plus_ensure_instance()
_media_browser_plus_ensure_field_folder in ./media_browser_plus.install
Make sure the field_tags field exists and is of the right type.
_media_browser_plus_ensure_field_tags in ./media_browser_plus.install
Make sure the field_tags field exists and is of the right type.

File

./media_browser_plus.install, line 126
Install file for media_browser_plus.

Code

function _media_browser_plus_ensure_instance($instance) {
  $existing_instance = field_info_instance($instance['entity_type'], $instance['field_name'], $instance['bundle']);
  if (empty($existing_instance)) {
    field_create_instance($instance);
  }
}