Created
February 16, 2013 14:31
-
-
Save masiorama/4967141 to your computer and use it in GitHub Desktop.
PHP: Wordpress widget skeleton
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: Wordpress widget skeleton | |
class My_Widget extends WP_Widget { | |
public function __construct() { | |
// widget actual processes | |
} | |
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