Created
May 1, 2017 14:16
-
-
Save carlodaniele/c63babea63df98a92fea9f42af3b8358 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 | |
/** | |
* @package Kinsta_widget | |
* @version 1.0 | |
*/ | |
/* | |
Plugin Name: Kinsta Widget | |
Plugin URI: http://wordpress.org/extend/plugins/# | |
Description: This is an example plugin | |
Author: Your Name | |
Version: 1.0 | |
Author URI: http://example.com/ | |
*/ | |
class Kinsta_Widget extends WP_Widget { | |
/** | |
* Sets up the widgets name etc | |
* | |
* @link https://developer.wordpress.org/reference/classes/wp_widget/__construct/ | |
* @see https://developer.wordpress.org/reference/functions/wp_register_sidebar_widget/ | |
* | |
*/ | |
public function __construct() {} | |
/** | |
* Outputs the content of the widget on front-end | |
* | |
* @param array $args Widget arguments | |
* @param array $instance | |
* | |
* @link https://developer.wordpress.org/reference/classes/wp_widget/widget/ | |
*/ | |
public function widget( $args, $instance ) {} | |
/** | |
* Outputs the options form on admin | |
* | |
* @param array $instance The widget options | |
* | |
* @link https://developer.wordpress.org/reference/classes/wp_widget/form/ | |
*/ | |
public function form( $instance ) {} | |
/** | |
* Processing widget options on save | |
* | |
* @param array $new_instance The new options | |
* @param array $old_instance The previous options | |
* | |
* @link https://developer.wordpress.org/reference/classes/wp_widget/update/ | |
*/ | |
public function update( $new_instance, $old_instance ) {} | |
} | |
// register Kinsta_Widget | |
add_action( 'widgets_init', function(){ | |
register_widget( 'Kinsta_Widget' ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment