Created
October 16, 2016 21:40
-
-
Save islandjoe/d93df53b05e1b20695902ec3ece9dfa0 to your computer and use it in GitHub Desktop.
WordPress widget template
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 MyWidget extends WP_Widget { | |
/** Widget setup **/ | |
function MyWidget() { | |
parent::WP_Widget(false, | |
__( 'My Widget', 'mytextdomain' ), | |
['description' => __( 'Displays a list of stuff', 'mytextdomain' )], | |
['width' => '400px'] | |
); | |
} | |
/** The back-end form **/ | |
function form( $instance ) { | |
} | |
/** Saving form data **/ | |
function update( $new_instance, $old_instance ) { | |
} | |
/** The front-end display **/ | |
function widget( $args, $instance ) { | |
} | |
} | |
register_widget('MyWidget'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment