Width of textarea box when editing widget (3 posts)

  1. RedSlug
    Posted 5 years ago #

    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?

  2. Michael
    Forum Moderator
    Posted 5 years ago #

    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);
  3. RedSlug
    Posted 5 years ago #

    Thanks for your help :-)

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.