/** * Initialize the plugin */ public function hookInitialize() { add_translation_source(dirname(__FILE__) . '/languages'); $db = get_db(); // Add filters $filter_names = array('Display', 'ElementInput'); $referenceElements = SELF::_retrieveReferenceElements(); foreach ($referenceElements as $element_id) { $element = $db->getTable('Element')->find($element_id); $elementSet = $db->getTable('ElementSet')->find($element->element_set_id); foreach ($filter_names as $filter_name) { add_filter(array($filter_name, 'Item', $elementSet->name, $element->name), array($this, "filter{$filter_name}")); } } SELF::$_withGeoLoc = SELF::_withGeoLoc(); SELF::$_withSecondLevel = !!intval(get_option('item_references_second_level')); SELF::$_enhancedGeoLog = (SELF::$_withGeoLoc and $db->fetchOne("SHOW COLUMNS FROM {$db->Locations} LIKE 'overlay'")); }