Skip to content

Instantly share code, notes, and snippets.

@ArnaudBan
Created June 11, 2012 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ArnaudBan/2908910 to your computer and use it in GitHub Desktop.
Save ArnaudBan/2908910 to your computer and use it in GitHub Desktop.
WordPress Widget - Show large form in the widget admin window
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