WordPress.org

Support

Support » Plugins and Hacks » Hacks » Width of textarea box when editing widget

Width of textarea box when editing widget

  • I’ve created a new widget (My first!!) which involves the user editing some text in a textarea box.

    The box is tiny. I wondered what is the best way to make this larger (width) than the current default size, which is only 25 characters wide.

    Is there a way to pop-up a larger box, or a plugin you can suggest?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael
    Forum Moderator

    @alchymyth

    have a look into wp-includes/default-widgets.php how it is done for the default text widget:

    line 365++:
    (the line with ‘control_ops…’)

    /**
     * Text widget class
     *
     * @since 2.8.0
     */
    class WP_Widget_Text extends WP_Widget {
    
    	function WP_Widget_Text() {
    		$widget_ops = array('classname' => 'widget_text', 'description' => __('Arbitrary text or HTML'));
    		$control_ops = array('width' => 400, 'height' => 350);
    		$this->WP_Widget('text', __('Text'), $widget_ops, $control_ops);
    	}

    Thanks for your help 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Width of textarea box when editing widget’ is closed to new replies.