WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How do I create a wide Widget Options Form? (4 posts)

  1. datdesignguy
    Member
    Posted 2 years ago #

    Hi Guys,

    coding a widget that has two textareas in it that would definitely benefit from a wider interface for the Widget Options in the Admin.

    Can anyone tell me how to make it so that the Widget Options panel expands outwards like the Text-Widget Options panel does?

    I hope I've explained myself well enough to get an answer. I'm sure its something simple, but I haven't found the answer, yet.

    Thanks,

    - Greg

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    Just add class="widefat" to your input fields.

  3. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    have a look for instance into the code of the default textwidget in /wp-includes/default-widgets.php:

    class WP_Widget_Text extends WP_Widget {
    
    	function __construct() {
    		$widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML'));
    		$control_ops = array('width' => 400, 'height' => 350);
    		parent::__construct('text', __('Text'), $widget_ops, $control_ops);
    	}

    and http://codex.wordpress.org/Widgets_API#Developing_Widgets

  4. datdesignguy
    Member
    Posted 2 years ago #

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic