+/**
+ * CRM-15191 - Hack to ensure the cache gets cleared after updating a custom field.
+ *
+ * @param array $params
+ * Array per getfields metadata.
+ *
+ * @return array
+ */
+function civicrm_api3_custom_field_setvalue($params) {
+ require_once 'api/v3/Generic/Setvalue.php';
+ $result = civicrm_api3_generic_setValue(array("entity" => 'CustomField', 'params' => $params));
+ if (empty($result['is_error'])) {
+ CRM_Utils_System::flushCache();
+ }
+ return $result;
+}