* @link http://wp-dreams.com, http://codecanyon.net/user/anago/portfolio * @copyright Copyright (c) 2014, Ernest Marcinko */ class wpdreamsCustomPostTypesEditable extends wpdreamsType { function getType() { parent::getType(); $this->processData(); $this->types = get_post_types(array( '_builtin' => false )); echo "
" . $this->label . ""; echo '

Available post types

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

Drag here the post types you want to use!

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