* @link http://wp-dreams.com, http://codecanyon.net/user/anago/portfolio
* @copyright Copyright (c) 2014, Ernest Marcinko
*/
class wpdreamsTaxonomySelect extends wpdreamsType {
private $types, $selected, $otype, $v;
private $exclude = array(
'product_visibility', 'product_type'
);
function getType() {
parent::getType();
$this->processData();
$this->types = $this->getAllTaxonomies();
echo "
";
}
function getAllTaxonomies() {
$args = array(
'_builtin' => false
);
$output = 'objects'; // or objects
$operator = 'and'; // 'and' or 'or'
$taxonomies = get_taxonomies($args, $output, $operator);
return $taxonomies;
}
function processData() {
if (is_array($this->data) && isset($this->data['type']) && isset($this->data['value'])) {
$this->otype = $this->data['type'];
$this->v = str_replace("\n", "", $this->data["value"]);
$this->data = $this->data["value"];
} else {
$this->otype = "include";
$this->v = str_replace("\n", "", $this->data);
}
$this->selected = array();
if ($this->v != "") {
$this->selected = explode("|", $this->v);
} else {
$this->selected = null;
}
}
final function getData() {
return $this->data;
}
final function getSelected() {
return $this->selected;
}
}
}