term_id] = $menu->name; } } break; } return $arr; } public static function print_scripts() { echo ''; } public static function text($args) { $defaults = array( 'name' => '', 'label' => '', 'description' => '', 'value' => '', 'html_class' => '', 'html_id' => '', ); $args = wp_parse_args($args, $defaults); $html = '
'; return $html; } public static function select($args) { $defaults = array( 'name' => '', 'label' => '', 'description' => '', 'options' => array(), 'value' => '', 'html_class' => '', 'html_id' => '', ); $args = wp_parse_args($args, $defaults); if (is_string($args['options'])) { $args['options'] = self::_helper($args['options']); } $html = '
'; if(!empty($args['description'])) { $html .= '' . $args['description'] . ''; } $html .= '
'; return $html; } public static function color($args) { wp_enqueue_style('wp-color-picker'); wp_enqueue_script('wp-color-picker'); add_action('admin_footer-widgets.php', array(new Self, 'print_scripts'), 9999); $defaults = array( 'name' => '', 'label' => '', 'description' => '', 'value' => '#ffffff', 'default' => '#ffffff' ); $args = wp_parse_args($args, $defaults); $html = ''; return $html; } }