Created
June 11, 2012 07:34
-
-
Save ArnaudBan/2908910 to your computer and use it in GitHub Desktop.
WordPress Widget - Show large form in the widget admin window
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class My_Widget extends WP_Widget { | |
public function __construct() { | |
parent::__construct( | |
'mywidget', // Base ID | |
'My Widget', // Name | |
array( | |
'description' => 'This widget will show a large form', | |
'class' => 'mywidget-class' | |
),// Args | |
array('width' => 400) // There is the trick | |
); | |
} | |
public function form( $instance ) { | |
// outputs the options form on admin | |
} | |
public function update( $new_instance, $old_instance ) { | |
// processes widget options to be saved | |
} | |
public function widget( $args, $instance ) { | |
// outputs the content of the widget | |
} | |
} | |
register_widget( 'My_Widget' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment