function tk_form_textfield($name, $args = array(), $return_object = FALSE) { $textfield = new TK_WP_Form_Textfield($name, $args); if (TRUE == $return_object) { return $textfield; } else { return $textfield->get_html(); } }
* * @param string $name Name of colorfield * @param array $args Array of [ $id , $extra Extra colorfield code, option_groupOption group to save data, $before_textfield Code before colorfield, $after_textfield Code after colorfield ] */ function tk_jquery_colorpicker($name, $args = array()) { $this->__construct($name, $args); } /** * PHP 5 constructor *
function get_html() { $this->merge_autocomplete_elements(); $html = parent::get_html(); $autocomplete_values = array(); foreach ($this->autocomplete_values as $key => $value) { array_push($autocomplete_values, '"' . $value . '"'); } $values = implode(',', $autocomplete_values); $html .= ' <script type="text/javascript"> jQuery(document).ready(function($){ $("#' . $this->id . '").autocomplete({ source: [' . $values . '] }); }); </script> '; return $html; }