Created
March 29, 2013 04:46
-
-
Save mucsher/5268799 to your computer and use it in GitHub Desktop.
Widget Wordpress Default User
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
<?php | |
/* | |
Plugin Name: | |
Plugin URI: | |
Description: | |
Version: 1.0.0 | |
Author: Mucsher | |
Author URI: | |
Text Domain: | |
Domain Path: /lang | |
*/ | |
class My_Widget extends WP_Widget { | |
public function __construct() { | |
parent::__construct( | |
'base_id', | |
'name', | |
array( | |
'description' => __('text descript', 'text-domain') | |
) | |
); | |
// widget actual processes | |
} | |
public function widget( $args, $instance ) { | |
// outputs the content of the widget | |
} | |
public function form( $instance ) { | |
// outputs the options form on admin | |
} | |
public function update( $new_instance, $old_instance ) { | |
// processes widget options to be saved | |
} | |
} | |
// register Foo_Widget widget | |
add_action( 'widgets_init', create_function( '', 'register_widget( "My_Widget" );' ) ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment