Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- Plugin Name: S3 slideshow widget, uses s3 slider plugin
- */
- class S3_Slideshow_Widget extends WP_Widget{
- function s3_slideshow_widget() {
- parent::WP_Widget( false, $name = __( 'S3 Slideshow', 'bpmag' ) );
- }
- function widget($args, $instance) {
- extract( $args );
- echo $before_widget;
- if(!empty($instance['title']))
- echo $before_title. $instance['title']. $after_title;
- if (function_exists(s3slider_show())) { s3slider_show(); }
- echo $after_widget;
- }
- function update( $new_instance, $old_instance ) {
- $instance=$old_instance;
- $instance["title"]=$new_instance["title"];
- return $instance;
- }
- function form($instance){
- $instance=wp_parse_args((array)$instance,array("title"=>"S3 Slideshow"));
- $title=strip_tags($instance["title"]);?>
- <p>
- <label for="slide-widget-title"><?php _e('Title:', 's3'); ?>
- <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo attribute_escape( stripslashes( $title ) ); ?>" />
- </label>
- </p>
- <?php
- //for showing the form code
- }
- }
- function register_s3_widget() {
- add_action('widgets_init', create_function('', 'return register_widget("S3_Slideshow_Widget");') );
- }
- add_action( 'plugins_loaded', 'register_s3_widget' );
- ?>
Add Comment
Please, Sign In to add comment