Thursday 21 March 2013

Wordpress Plugin that shows your latest Ow.ly image in a Widget

This a follow up to the blog How to make a Wordpress Widget Plugin

My aim here is to make Wordpress Plugin that shows your latest Ow.ly image in a Widget .   If you make a folder called 'owdotly-image' in the 'wp-content/plugins/' folder  and then save the following code as file 'owdotly.php'  this will work.  I'll add some CSS to it and then try and get it added to the official Wordpress directory.


 __('This widget will show your latest Ow.ly image',''),));
}
  
  
  function form($instance) {     
    $instance = wp_parse_args((array) $instance, array( 'title' => '', 'twit_username' => ''));
    $title = $instance['title'];
	$twit_username = $instance['twit_username'];
?>
  

', $array); list($newimage, $junk) = explode('"', $imageplus); $info = 'Polzeath nowClick here for the latest image.'; return $info; } function widget($args, $instance) { $Title = $instance['title']; $User = $instance['twit_username']; echo "

$Title

"; echo ''.$this->get_owdotly_page($User).''; } } add_action( 'widgets_init', create_function('', 'return register_widget("Owdotly_Image_Widget");') ); ?>

No comments: