* @link http://wp-dreams.com, http://codecanyon.net/user/anago/portfolio * @copyright Copyright (c) 2014, Ernest Marcinko */ class wpdreamsTermMeta extends wpdreamsType { private $types, $selected; function getType() { parent::getType(); global $wpdb; $this->processData(); // Bail if term meta table is not installed. if ( get_option( 'db_version' ) < 34370 ) { echo ""; return false; } $this->types = $wpdb->get_results("SELECT DISTINCT(meta_key) FROM " . $wpdb->termmeta . " LIMIT 1500", ARRAY_A); echo "
" . $this->label . ""; echo '

' . __('Available term meta keys', 'ajax-search-pro') . '

    '; if ($this->types != null && is_array($this->types)) { foreach ($this->types as $k => $v) { if ($this->selected == null || !in_array($v['meta_key'], $this->selected)) { echo '
  • ' . $v['meta_key'] . '
  • '; } } } echo "
"; echo '

' . __('Drag here the meta keys you want to use!', 'ajax-search-pro') . '

    '; if ($this->selected != null && is_array($this->selected)) { foreach ($this->selected as $k => $v) { echo '
  • ' . $v . '
  • '; } } echo "
"; echo " "; echo " "; echo "
"; } function processData() { $this->data = str_replace("\n", "", $this->data); if ($this->data != "") $this->selected = explode("|", $this->data); else $this->selected = null; } final function getData() { return $this->data; } final function getSelected() { return $this->selected; } } }