Created
February 4, 2012 17:29
-
-
Save jchristopher/1739071 to your computer and use it in GitHub Desktop.
Basic instantiation of an "Image of the Month" WordPress Widget
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 | |
// we can only use this Widget if the plugin is active | |
if( class_exists( 'WidgetImageField' ) ) | |
add_action( 'widgets_init', create_function( '', "register_widget( 'ITI_Widget_Image_OTM' );" ) ); | |
class ITI_Widget_Image_OTM extends WP_Widget | |
{ | |
var $image_field = 'image'; // the image field ID | |
function __construct() | |
{ | |
$widget_ops = array( | |
'classname' => 'image_otm', | |
'description' => __( 'Image of the Month' ) | |
); | |
parent::__construct( 'image_otm', __( 'Image of the Month' ), $widget_ops ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment