public static function init() { if (!self::$_instance) { self::$_instance = new WPUF_Render_Form(); } return self::$_instance; }
/** * Returns child category dropdown on ajax request */ function wpuf_get_child_cats() { $parentCat = $_POST['catID']; $field_attr = $_POST['field_attr']; $taxonomy = $_POST['field_attr']['name']; $terms = null; $result = ''; if ($parentCat < 1) { die($result); } if ($terms = get_categories('taxonomy=' . $taxonomy . '&child_of=' . $parentCat . '&hide_empty=0')) { $field_attr['parent_cat'] = $parentCat; if (is_array($terms)) { foreach ($terms as $key => $term) { $terms[$key] = (array) $term; } } $result .= WPUF_Render_Form::init()->taxnomy_select('', $field_attr); } else { die(''); } die($result); }
/** * Returns child category dropdown on ajax request */ function wpuf_get_child_cats() { $parentCat = $_POST['catID']; $field_attr = $_POST['field_attr']; $taxonomy = $_POST['field_attr']['name']; $terms = null; $result = ''; if ($parentCat < 1) { die($result); } if (get_categories('taxonomy=' . $taxonomy . '&child_of=' . $parentCat . '&hide_empty=0')) { $field_attr['parent_cat'] = $parentCat; $result .= WPUF_Render_Form::init()->taxnomy_select($terms, $field_attr); } else { die(''); } die($result); }