Last active
April 18, 2017 09:23
-
-
Save kantoniak/45d6d432bbba6aa5d4992b74d344d660 to your computer and use it in GitHub Desktop.
This file contains 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
<?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