Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
class MyNewWidget extends WP_Widget {
function __construct() {
// Instantiate the parent object
parent::__construct('mynewwidgetbaseid, 'My New Widget Title');
}
function widget($args, $instance) {
// Widget output
}
function update($new_instance, $old_instance) {
// Save widget options
}
function form($instance) {
// Output admin widget options form
}
}
function myplugin_register_widgets() {
register_widget('MyNewWidget');
}
add_action('widgets_init', 'myplugin_register_widgets');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment