/** * Register widget with WordPress. */ public function __construct() { parent::__construct('mp_stacks_widget', 'MP Stacks', array('description' => __('Display A Stack from MP Stacks.', 'mp_stacks'))); //enqueue scripts defined in MP_CORE_Widget add_action('admin_enqueue_scripts', array($this, 'mp_widget_enqueue_scripts')); $this->_form = array("field1" => array('field_id' => 'title', 'field_title' => __('Title:', 'mp_stacks'), 'field_description' => NULL, 'field_type' => 'textbox'), "field1" => array('field_id' => 'stack_id', 'field_title' => __('Select a stack:', 'mp_stacks'), 'field_description' => NULL, 'field_type' => 'select', 'field_select_values' => mp_core_get_all_terms_by_tax('mp_stacks'))); }
/** * Register widget with WordPress. */ public function __construct() { parent::__construct('foo_widget', 'My Cool Widget', array('description' => __('A Foo Widget', 'text_domain'))); //enqueue scripts defined in MP_CORE_Widget add_action('admin_enqueue_scripts', array($this, 'mintplugins_enqueue_scripts')); $this->_form = array("foofield1" => array('field_id' => 'title', 'field_title' => __('Title', 'mp_core'), 'field_description' => __('Enter the title:', 'mp_core'), 'field_type' => 'textbox'), "foofield2" => array('field_id' => 'color', 'field_title' => __('Color', 'mp_core'), 'field_description' => __('Select a color:', 'mp_core'), 'field_type' => 'colorpicker'), "field3" => array('field_id' => 'my_text_area', 'field_title' => __('Text', 'mp_core'), 'field_description' => __('Enter some text:', 'mp_core'), 'field_type' => 'textarea'), "field4" => array('field_id' => 'my_image', 'field_title' => __('Image Upload', 'mp_core'), 'field_description' => __('Upload the image:', 'mp_core'), 'field_type' => 'mediaupload')); }