* @link http://wp-dreams.com, http://codecanyon.net/user/anago/portfolio
* @copyright Copyright (c) 2016, Ernest Marcinko
*/
class wd_CPT_Editable extends wpdreamsType {
private $types, $selected;
public function getType() {
parent::getType();
$this->processData();
echo "
";
}
public function processData() {
// Make sure that the correct variables are used
$this->selected = $this->decode_param($this->data);
$this->data = $this->encode_param($this->data);
$this->types = get_post_types(array(
"public" => true,
"_builtin" => false
), "objects", "OR");
foreach ($this->types as $k => $v) {
if (in_array($k, array(
"revision", "nav_menu_item", "attachment", "acf", "wpcf7_contact_form", "dslc_templates",
"acf-field", "acf-group", "acf-groups"
))) {
unset($this->types[$k]);
continue;
}
}
}
public final function getData() {
return $this->data;
}
public final function getSelected() {
return $this->selected;
}
}
}